/* Cari Perkataan: text-only, compact enough for a touch screen. */
#dialog:has(.ws-game){width:min(96vw,640px);max-width:640px;max-height:min(94dvh,980px);padding:0;overflow-y:auto;background:linear-gradient(160deg,#e3f4e7,#fff9ed 70%);border:1px solid #d7e6da;border-radius:24px}
#dialog:has(.ws-game) #dialogBody{padding:0}
.ws-game{padding:clamp(18px,4vw,28px);color:#17483d;text-align:center}
.ws-game .ws-eyebrow{font:800 .7rem Nunito,sans-serif;letter-spacing:.13em;color:#318768;margin:0 0 4px}
.ws-game h2{font-size:clamp(1.6rem,6vw,2.4rem);line-height:1.1;margin:0 0 7px;color:#143e35}
.ws-level{display:inline-block;margin:0 0 10px;padding:5px 14px;border-radius:999px;background:#fff0bf;color:#79510e;font-size:.83rem;font-weight:900}
.ws-instruction{font-size:.85rem;line-height:1.35;margin:0 auto 9px;max-width:420px;color:#44665b}
.ws-progress-row{display:flex;align-items:center;gap:12px;font-size:.8rem;margin:0 0 4px;white-space:nowrap;text-align:left}
.ws-track{flex:1;height:8px;border-radius:999px;background:#d6e9db;overflow:hidden}.ws-track span{display:block;width:0;height:100%;border-radius:inherit;background:#338c65;transition:width .2s}
.ws-message{min-height:1.25em;margin:2px 0;color:#20765d;font-size:.78rem;font-weight:800}
.ws-grid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));width:min(100%,500px);aspect-ratio:1;margin:auto;border:1px solid #e0e8dc;border-radius:18px;padding:5px;background:#fffefa;touch-action:none;user-select:none;-webkit-user-select:none}
.ws-cell{display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;width:100%;height:100%;padding:0;border:0;border-radius:8px;background:transparent;color:#184b3d;box-shadow:none;font:900 clamp(.9rem,4vw,1.35rem) Nunito,sans-serif;touch-action:none;user-select:none;-webkit-user-select:none}
.ws-cell.is-found{background:#d6efda}.ws-cell.is-selected{background:#ffdf85}.ws-cell.is-hint{background:#ffe2a4;outline:2px solid #c28b23}.ws-cell:focus-visible{outline:2px solid #1c8265;outline-offset:-2px}
.ws-words{margin:12px 0 0;padding:12px;background:#fffdfa;border:1px solid #e6eadd;border-radius:16px;text-align:left}.ws-words h3{margin:0 0 8px;font-size:1rem;color:#19493d}.ws-word-list{display:flex;flex-wrap:wrap;gap:6px}.ws-word-list span{padding:4px 9px;border:1px solid #c9dfce;border-radius:999px;color:#315f4c;font:800 .76rem Nunito,sans-serif}.ws-word-list span.is-found{background:#d7efdb;border-color:#d7efdb;color:#377b52;text-decoration:line-through}
.ws-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:12px}.ws-actions button{min-height:40px;padding:8px 14px;border-radius:999px;font-size:.82rem;font-weight:900}.ws-actions #wsHint,.ws-actions #wsNext{background:#ffdb7d;border-color:#ffdb7d;color:#654810}.ws-actions #wsReset{background:#fffdfa;border:1px solid #c6d9cb;color:#315d4b}
.ws-levels{display:flex;justify-content:center;gap:8px;margin-top:12px}.ws-levels button{min-width:38px;min-height:38px;padding:0;border-radius:50%;background:#fffdfa;border:1px solid #c6d9cb;color:#32654f;font-weight:900}.ws-levels button[aria-current]{background:#32885e;border-color:#32885e;color:#fff}
@media (max-height:700px){.ws-game{padding-top:12px}.ws-game h2{font-size:1.55rem}.ws-instruction{margin-bottom:4px}.ws-grid{max-width:min(100%,42vh)}.ws-words{margin-top:8px;padding:8px}.ws-actions,.ws-levels{margin-top:8px}}

/* Full-bleed phone app: leave the background behind the Android system bars,
   while keeping all content and controls clear of their insets. */
html.jejak-app-phone dialog#dialog:has(.ws-game){
 position:fixed;inset:0!important;width:100%!important;max-width:none!important;
 height:100dvh!important;max-height:100dvh!important;margin:0!important;padding:0!important;
 border:0!important;border-radius:0!important;box-shadow:none!important;
 overflow-y:auto;scrollbar-gutter:auto;
}
html.jejak-app-phone #dialog:has(.ws-game) #dialogBody{padding:0!important}
html.jejak-app-phone .ws-game{
 max-width:520px;margin:0 auto;
 padding:calc(max(env(safe-area-inset-top),var(--jejak-app-inset-top,0px)) + 8px)
 max(14px,env(safe-area-inset-right))
 calc(max(12px,env(safe-area-inset-bottom),var(--jejak-app-inset-bottom,0px)) + 8px)
 max(14px,env(safe-area-inset-left));
}
html.jejak-app-phone .ws-game .ws-eyebrow{margin:0 0 2px;font-size:.65rem}
html.jejak-app-phone .ws-game h2{font-size:clamp(1.45rem,5.8vw,1.8rem);line-height:1.08;margin:0 0 4px}
html.jejak-app-phone .ws-level{margin:0 0 6px;padding:4px 12px;font-size:.78rem}
html.jejak-app-phone .ws-instruction{font-size:.8rem;line-height:1.25;margin:0 auto 7px}
html.jejak-app-phone .ws-progress-row{margin:0;gap:9px}
html.jejak-app-phone .ws-message{min-height:1.15em;line-height:1.15;margin:2px 0 4px}
html.jejak-app-phone .ws-grid{width:min(100%,max(300px,calc(100dvh - 360px)));max-width:100%;padding:4px;border-radius:15px}
html.jejak-app-phone .ws-cell{font-size:clamp(.85rem,4vw,1.2rem)}
html.jejak-app-phone .ws-words{margin:8px 0 0;padding:9px;border-radius:14px;text-align:center}
html.jejak-app-phone .ws-words h3{margin:0 0 6px;font-size:.92rem}
html.jejak-app-phone .ws-word-list{gap:4px;justify-content:center}
html.jejak-app-phone .ws-word-list span{padding:3px 8px;font-size:.72rem;line-height:1.25}
html.jejak-app-phone .ws-actions{gap:8px;margin-top:8px}
html.jejak-app-phone .ws-actions button{min-height:44px;padding:7px 14px}
html.jejak-app-phone .ws-levels{gap:8px;margin-top:7px}
html.jejak-app-phone .ws-levels button{min-width:44px;min-height:44px}

/* Browser tablet/desktop: the same real page header as Teka Silang, with a
   large board beside the word list and controls. The WebView stays unchanged. */
html:not(.jejak-app) body.silang-wide:has(#app .ws-game)>main{max-width:none;margin:0 auto;padding:16px clamp(20px,3vw,40px) 32px}
html:not(.jejak-app) #app .ws-game{max-width:1220px;margin:auto;padding:0;text-align:left}
html:not(.jejak-app) #app .ws-game>.ws-eyebrow,
html:not(.jejak-app) #app .ws-game>h2{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html:not(.jejak-app) #app .ws-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,300px);gap:clamp(20px,3vw,40px);align-items:start}
html:not(.jejak-app) #app .ws-board{min-width:0;display:flex;justify-content:center}
html:not(.jejak-app) #app .ws-grid{width:min(100%,700px,calc(100dvh - 125px));max-width:none;min-width:0;margin:0;border-radius:18px;padding:5px;gap:0}
html:not(.jejak-app) #app .ws-cell{font-size:clamp(1.05rem,2.3vw,1.7rem);background:transparent;border:0;border-radius:8px}
html:not(.jejak-app) #app .ws-cell.is-found{background:#d6efda}
html:not(.jejak-app) #app .ws-cell.is-selected{background:#ffdf85}
html:not(.jejak-app) #app .ws-cell.is-hint{background:#ffe2a4}
html:not(.jejak-app) #app .ws-side{min-width:0;text-align:left}
html:not(.jejak-app) #app .ws-level{margin-bottom:10px}
html:not(.jejak-app) #app .ws-instruction{margin:0 0 12px;max-width:none;font-size:.88rem}
html:not(.jejak-app) #app .ws-message{min-height:1.3em;margin:6px 0}
html:not(.jejak-app) #app .ws-words{margin:8px 0 0;padding:18px;background:#fffdfa;border-radius:20px}
/* Keep the list heading available to screen readers without showing it. */
html:not(.jejak-app) #app .ws-words h3{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html:not(.jejak-app) #app .ws-word-list{gap:7px}
html:not(.jejak-app) #app .ws-word-list span{font-size:.84rem;padding:5px 10px}
html:not(.jejak-app) #app .ws-actions{flex-direction:column;gap:8px;margin-top:14px}
html:not(.jejak-app) #app .ws-actions button{width:100%;min-height:44px;border-radius:14px}
html:not(.jejak-app) #app .ws-actions #wsHint{background:#2f8a5f;border-color:#2f8a5f;color:#fff}
html:not(.jejak-app) #app .ws-levels{flex-wrap:wrap;justify-content:center;margin-top:14px}
@media(max-width:679px){html:not(.jejak-app) #app .ws-layout{grid-template-columns:1fr}html:not(.jejak-app) #app .ws-grid{width:min(100%,500px)}}
