#dialog:has(.jh-game){width:min(94vw,620px);max-height:94dvh;overflow:auto;background:linear-gradient(155deg,#e8f5e9,#fff9ed);padding:24px;border-radius:24px}
.jh-game{max-width:540px;margin:auto;color:#17483d;text-align:center}.jh-eyebrow{font-size:11px;font-weight:900;letter-spacing:1.5px;margin:0 0 6px}.jh-game h2{font-size:32px;margin:0 0 10px}.jh-topic{display:inline-block;background:#ffedb1;color:#76500e;border-radius:99px;padding:6px 14px;margin:0 0 10px;font-size:13px;font-weight:900}.jh-progress{height:6px;background:#d4e8d9;border-radius:9px;margin-bottom:18px;overflow:hidden}.jh-progress span{display:block;height:100%;background:#32885e}.jh-question{background:#fffefb;border:1px solid #d9e5d9;border-radius:22px;padding:20px 18px;margin-bottom:20px}.jh-question p{font-size:10px;font-weight:900;letter-spacing:1px;color:#397c60;margin:0 0 10px}.jh-question h3{font-size:clamp(19px,5vw,25px);line-height:1.45}.jh-slots{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}.jh-answer-word{display:flex;flex-wrap:wrap;justify-content:center;gap:4px}.jh-slot{padding:0;width:clamp(28px,8vw,42px);height:44px;border:1.5px solid #acc9b7;border-radius:10px;font-size:20px;font-weight:900;background:#fffefa}.jh-slot.active{border:2px solid #d3a32a;background:#fff6d4}.jh-instruction{font-size:12px;line-height:1.5;color:#567164;margin:12px 0 4px}.jh-tools{display:flex;justify-content:center;gap:10px;margin-bottom:12px}.jh-tools button{min-height:44px;font-size:12px;padding:6px 14px;background:transparent;border:0;text-decoration:underline}.jh-tiles{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;background:#fffefa;border:1px solid #d9e5d9;border-radius:22px;padding:16px}.jh-tiles button{width:48px;min-height:48px;padding:0;font-size:24px;font-weight:900;background:#fffefa;border:1.5px solid #bfd3c4}.jh-tiles button:disabled{opacity:.25}.jh-game #jhMessage{min-height:24px;font-size:13px;font-weight:800;margin:12px 0}.jh-actions{display:flex;justify-content:center;gap:10px}.jh-actions button{min-height:48px;flex:1;font-size:14px;border-radius:99px}.jh-actions .primary,.jh-result .primary{background:#ffda77;border-color:#ffda77;color:#674812;box-shadow:none}.jh-bank{font-size:11px;color:#60766a;line-height:1.4;margin:14px 0 0}.jh-source{font-size:12px;margin-bottom:12px}.jh-source p{line-height:1.4}.jh-result{padding:40px 12px}
/* Match the quick-game card while keeping room for the native system bars. */
html.jejak-app-phone dialog#dialog:has(.jh-game){position:fixed;inset:max(12px,env(safe-area-inset-top),var(--jejak-app-inset-top,0px)) 0 max(12px,env(safe-area-inset-bottom),var(--jejak-app-inset-bottom,0px))!important;width:calc(100% - 24px)!important;max-width:620px!important;height:fit-content!important;max-height:calc(100dvh - max(12px,env(safe-area-inset-top),var(--jejak-app-inset-top,0px)) - max(12px,env(safe-area-inset-bottom),var(--jejak-app-inset-bottom,0px)))!important;margin:auto!important;border:0!important;border-radius:28px!important;padding:0!important;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:auto}
html.jejak-app-phone #dialog:has(.jh-game) #dialogBody{padding:0!important}
@media(max-height:700px){.jh-question{padding:12px;margin-bottom:12px}.jh-game h2{font-size:26px}.jh-progress{margin-bottom:10px}.jh-tiles{padding:10px;gap:6px}}
#dialog .jh-actions .primary,#dialog .jh-result .primary{background:#ffda77;border-color:#ffda77;color:#674812;box-shadow:none}
#dialog .jh-slot:hover,#dialog .jh-tiles button:hover{transform:none}
/* Keep the question, multiword answer and actions together on app phones. */
html.jejak-app-phone .jh-game{padding:22px 18px 20px}
html.jejak-app-phone .jh-eyebrow{font-size:10px;margin-bottom:3px}
html.jejak-app-phone .jh-game h2{font-size:28px;margin-bottom:6px}
html.jejak-app-phone .jh-topic{padding:4px 12px;margin-bottom:7px;font-size:12px}
html.jejak-app-phone .jh-progress{margin-bottom:12px}
html.jejak-app-phone .jh-question{padding:14px;margin-bottom:14px}
html.jejak-app-phone .jh-question p{margin-bottom:6px}
html.jejak-app-phone .jh-question h3{font-size:clamp(18px,4.7vw,22px);line-height:1.35}
html.jejak-app-phone .jh-slots{gap:6px}
html.jejak-app-phone .jh-slot{height:40px}
html.jejak-app-phone .jh-instruction{white-space:nowrap;font-size:12px;line-height:1.3;margin:8px 0 0}
.jh-tools button{text-decoration:none}
html.jejak-app-phone .jh-tools{margin-bottom:6px}
html.jejak-app-phone .jh-tiles{padding:10px;gap:4px}
html.jejak-app-phone .jh-tiles button{width:44px;min-height:44px;font-size:22px}
html.jejak-app-phone .jh-game #jhMessage{min-height:20px;margin:7px 0}
html.jejak-app-phone .jh-source{margin-bottom:6px}
html.jejak-app-phone .jh-bank{margin-top:8px;font-size:10px}
/* Use the same simple clue and letter treatment as Hangman; keep the
   separate answer slots and game actions for the word arrangement. */
html.jejak-app-phone .jh-topic{background:#dff1e6;color:#348363}
html.jejak-app-phone .jh-question{background:transparent;border:0;border-radius:0;padding:2px 0;margin-bottom:16px}
html.jejak-app-phone .jh-question h3{font-size:clamp(17px,4.3vw,20px);font-weight:600;line-height:1.45;color:#69756b}
html.jejak-app-phone .jh-tiles{background:transparent;border:0;border-radius:0;padding:4px 0}
html.jejak-app-phone .jh-instruction{white-space:normal}
html.jejak-app-phone .jh-game #jhMessage:empty{display:none}

/* The two published mind games also fill the browser viewport. Keep their
   content readable on wide displays and scrollable on short ones. */
html:not(.jejak-app-phone) dialog#dialog:is(:has(.jh-game),: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:not(.jejak-app-phone) dialog#dialog:is(:has(.jh-game),:has(.ws-game)) #dialogBody{padding:0!important}
html:not(.jejak-app-phone) dialog#dialog:is(:has(.jh-game),:has(.ws-game)) #closeDialog{
 position:fixed;z-index:2;top:max(10px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:auto;
 width:auto!important;min-width:44px;height:44px;min-height:44px;padding:0 15px;border:1px solid #c9dfce!important;
 border-radius:999px!important;background:#fffdf6!important;color:#286a55!important;font-size:0!important;line-height:1;box-shadow:0 3px 12px #26533c16!important;
}
html:not(.jejak-app-phone) dialog#dialog:is(:has(.jh-game),:has(.ws-game)) #closeDialog::after{
 content:'← Kembali';font:800 14px/1 Nunito,system-ui,sans-serif;
}
html[lang=en]:not(.jejak-app-phone) dialog#dialog:is(:has(.jh-game),:has(.ws-game)) #closeDialog::after{content:'← Back'}
html:not(.jejak-app-phone) dialog#dialog:is(:has(.jh-game),:has(.ws-game)) #closeDialog:hover{background:#e5f3e8;transform:none}
html:not(.jejak-app-phone) #dialog .jh-game,
html:not(.jejak-app-phone) #dialog .ws-game{
 max-width:540px;margin:0 auto;padding:calc(max(10px,env(safe-area-inset-top)) + 54px) max(16px,env(safe-area-inset-right)) calc(max(16px,env(safe-area-inset-bottom)) + 20px) max(16px,env(safe-area-inset-left));
}
html:not(.jejak-app-phone) #dialog .ws-grid{max-width:100%}
html:not(.jejak-app-phone) #dialog:is(:has(.jh-game),:has(.ws-game)) h2{padding:0}
@media(max-width:600px){
 html:not(.jejak-app-phone) #dialog .ws-grid{width:min(100%,max(270px,calc(100dvh - 525px)))}
 html:not(.jejak-app-phone) #dialog .ws-words{text-align:center;padding:9px}
 html:not(.jejak-app-phone) #dialog .ws-word-list{justify-content:center;gap:4px}
 html:not(.jejak-app-phone) #dialog .ws-word-list span{padding:3px 8px}
 html:not(.jejak-app-phone) #dialog .ws-actions{margin-top:8px}
 html:not(.jejak-app-phone) #dialog .ws-levels{margin-top:8px}
 html:not(.jejak-app-phone) #dialog .ws-actions button,
 html:not(.jejak-app-phone) #dialog .ws-levels button{min-height:44px}
}

/* Browser games retain their existing design in a real page, so the same
   functioning website header and Back/Home controls remain available. */
html:not(.jejak-app) body.silang-wide:has(#app .jh-game)>main{max-width:none;margin:0 auto;padding:16px max(16px,env(safe-area-inset-right)) 32px max(16px,env(safe-area-inset-left))}
html:not(.jejak-app) #app .jh-game{max-width:540px;margin:0 auto;color:#17483d}
html:not(.jejak-app) #app .jh-actions .primary,html:not(.jejak-app) #app .jh-result .primary{background:#ffda77;border-color:#ffda77;color:#674812;box-shadow:none}
@media(max-width:360px){html:not(.jejak-app) #app .jh-actions button{padding-inline:8px;font-size:12px}}
@media(max-width:600px),(max-width:950px) and (max-height:500px) and (pointer:coarse){
 html:not(.jejak-app) body.silang-wide:has(#app :is(.jh-game,.mg-hangman))>header #homeLink{display:flex!important;min-width:0;overflow:hidden}
 html:not(.jejak-app) body.silang-wide:has(#app :is(.jh-game,.mg-hangman))>header #homeLink .game-title-group{min-width:0;overflow:hidden}
 html:not(.jejak-app) body.silang-wide:has(#app :is(.jh-game,.mg-hangman))>header #homeLink .game-brand-title{overflow:hidden;text-overflow:ellipsis;font-size:14px}
 html:not(.jejak-app) body.silang-wide:has(#app :is(.jh-game,.mg-hangman))>header .mobile-game-name{display:none!important}
 html:not(.jejak-app) body.silang-wide:has(#app :is(.jh-game,.mg-hangman))>header nav #pageBack{display:inline-flex!important;align-items:center;min-height:40px;padding:4px 6px;font-size:11px}
 html:not(.jejak-app) body.silang-wide:has(#app :is(.jh-game,.mg-hangman))>header nav #silangBack{padding:4px 6px;font-size:11px}
}

/* Phone browsers: let the game fill the screen. Browser Back returns to the
   journey (and closes the word-search dialog); desktop and WebView are unchanged. */
html.mind-browser-phone body.silang-wide:has(#app :is(.jh-game,.mg-hangman))>header{display:none!important}
html.mind-browser-phone dialog#dialog:has(.ws-game) #closeDialog{display:none!important}
html.mind-browser-phone #dialog .ws-game{padding-top:max(16px,env(safe-area-inset-top))}

/* Keep the word list labelled for assistive technology without repeating the
   page title, and use the available phone height for a comfortable board. */
html.browser-phone #dialog .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.browser-phone #dialog .ws-game{padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right))}
html.browser-phone #dialog .ws-grid{width:min(100%,370px,max(280px,calc(100dvh - 425px)));max-width:100%}
html.browser-phone #dialog .ws-words{margin-top:10px;padding:9px;text-align:center}
html.browser-phone #dialog .ws-word-list{justify-content:center;gap:5px}
html.browser-phone #dialog .ws-word-list span{padding:3px 8px}
html.browser-phone #dialog .ws-actions,html.browser-phone #dialog .ws-levels{margin-top:8px}
html.browser-phone #dialog .ws-actions button,html.browser-phone #dialog .ws-levels button{min-height:44px}
html.browser-phone #dialog .ws-levels button{min-width:44px}

/* A compact, readable game page for phone browsers; long questions and
   multiword answers can still wrap naturally and the page remains scrollable. */
html.mind-browser-phone body.silang-wide:has(#app .jh-game)>main{padding:12px max(16px,env(safe-area-inset-right)) 24px max(16px,env(safe-area-inset-left))}
html.mind-browser-phone #app .jh-game{max-width:540px}
html.mind-browser-phone #app .jh-eyebrow{margin-bottom:4px}
html.mind-browser-phone #app .jh-game h2{font-size:30px;margin-bottom:8px}
html.mind-browser-phone #app .jh-topic{margin-bottom:8px}
html.mind-browser-phone #app .jh-progress{margin-bottom:14px}
html.mind-browser-phone #app .jh-question{padding:15px 14px;margin-bottom:16px}
html.mind-browser-phone #app .jh-question p{margin-bottom:6px}
html.mind-browser-phone #app .jh-question h3{font-size:clamp(19px,5vw,22px);line-height:1.35}
html.mind-browser-phone #app .jh-slots{gap:6px}
html.mind-browser-phone #app .jh-instruction{margin:10px 0 2px}
html.mind-browser-phone #app .jh-tools{margin-bottom:8px}
html.mind-browser-phone #app .jh-tiles{gap:6px;padding:12px}
html.mind-browser-phone #app .jh-tiles button{width:44px;min-height:44px;font-size:22px}
html.mind-browser-phone #app .jh-game #jhMessage{min-height:0;margin:8px 0}
html.mind-browser-phone #app .jh-game #jhMessage:empty{display:none}
html.mind-browser-phone #app .jh-actions{margin-top:14px}
html.mind-browser-phone #app .jh-bank{margin-top:10px}
