/* V56: layered welcome, compact emerald frame and accessible mission medals. */
:root{--frame-green:#084b39;--frame-gold:#d4b267;--frame-cream:#fbf6e5}
.welcome-gema-logo{display:none}
body:not(.exploring) .site-header{inset:12px 20px auto;gap:12px;justify-content:center}
body:not(.exploring) .site-header .brand{position:static;transform:none;left:auto;flex:0 0 auto;padding:6px 16px;height:62px;box-sizing:border-box;border-radius:24px;max-width:calc(100% - 290px);pointer-events:none}
body:not(.exploring) .site-header .brand-logo-full{width:245px;height:48px;max-width:100%;object-fit:contain}
body:not(.exploring) .site-header .welcome-gema-logo{display:block;flex:none;width:100px;height:62px;object-fit:contain;padding:6px 10px;box-sizing:border-box;background:#fff9e8f5;border:1px solid #cda64e;border-radius:21px;box-shadow:0 3px 12px #173c2720}
body:not(.exploring) #welcomeContent{inset:28% auto 8% 50%;width:min(1080px,77vw);gap:18px;justify-content:flex-end}
body:not(.exploring) #intro{position:relative;padding:25px max(95px,14%) 28px;border-radius:42px;overflow:visible}
body:not(.exploring) #intro h1{font-size:clamp(32px,min(4.4vw,7.3dvh),65px);line-height:1.05}
body:not(.exploring) #intro .intro-copy{font-size:clamp(16px,1.4vw,21px);max-width:660px}
body:not(.exploring) #intro .intro-actions{position:relative;z-index:3}
body:not(.exploring) #intro .eyebrow{white-space:nowrap}
.welcome-character{position:absolute;display:block;bottom:-8px;height:114%;max-height:400px;width:auto;aspect-ratio:3/4;z-index:2;pointer-events:none;background-image:url('assets/pustaka-v56/welcome-characters.webp');background-size:200% 100%;background-repeat:no-repeat;filter:drop-shadow(0 8px 5px #143e2633)}
.welcome-character.boy{left:-12%;background-position:left center}
.welcome-character.girl{right:-12%;background-position:right center}
#welcomeStations .welcome-station{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:83px;padding:10px 8px;box-sizing:border-box;border:1px solid #deb75c;border-radius:22px;background:#fff8e8f0;color:#084936;font-size:clamp(14px,1.2vw,18px);font-weight:700;line-height:1.2;text-align:center;box-shadow:0 4px 12px #15432e24;cursor:default}
body:not(.exploring) #welcomeFooter{bottom:8px;height:28px;font-size:15px}
/* Square sprite window preserves the original teacher illustration proportions. */
#teacherChoice .teacher-login-form{gap:13px;width:min(500px,100%);padding:6px 10px;overflow:auto}
#teacherChoice .teacher-portrait{flex:none;height:clamp(95px,17dvh,135px);width:auto;aspect-ratio:1;max-width:100%;max-height:none;margin:0 auto;background:url('assets/pustaka-v54/role-atlas.webp') left top/200% 200% no-repeat}
#accessDialog #teacherChoice h2{margin:0;font-size:clamp(27px,4vw,40px)}
#teacherChoice .teacher-login-form>p{margin:0;font-size:16px;line-height:1.4}
#teacherChoice .teacher-login-form>label{font-size:16px}
#teacherChoice #accessKey,#teacherChoice #accessServer{font-size:16px;min-height:43px;margin-top:5px;padding:10px 13px;box-sizing:border-box}
#teacherChoice .connection-settings{padding:10px 13px;font-size:15px}
#teacherChoice #teacherLogin{min-height:46px;padding:11px 15px;font-size:19px}
#teacherLoginStatus:empty{display:none}
.teacher-category{display:flex;flex-direction:column;gap:6px;margin:10px 0;font-size:14px}.teacher-category select{width:100%;min-width:0;font-size:14px!important;padding:10px!important}
/* Only the surrounding interface is restyled; dimensions stay compact. */
body.exploring .site-header{background:linear-gradient(110deg,#073f30,#135841 68%,#1c6249);color:#fff4d3;border-bottom:2px solid #d4b267;box-shadow:0 2px 12px #123b2c20;padding:7px 12px;gap:10px}
body.exploring .site-header .brand{color:#fff3ce;gap:8px}
body.exploring .site-header .brand-logo{border:0;padding:0;width:40px!important;height:40px!important}
body.exploring .site-header .brand>span{font-size:21px}
body.exploring .site-header #musicDock,body.exploring .site-header #logoutButton,body.exploring .site-header #menuToggle{background:#fff9e9;border:1px solid #d4b267;color:#154934;box-shadow:none;height:37px;border-radius:11px}
body.exploring .site-header #logoutButton{color:#835033}
body.exploring .site-header #musicToggle{color:#154934}
body.exploring #pustakaWorkspace{background:linear-gradient(110deg,#e3e9d6,#f7f4e7);padding-top:7px;column-gap:7px}
body.exploring #pustakaSidebar{background-image:linear-gradient(165deg,#134f3deb,#073c30f7),url('assets/pustaka-v55/botanical-pattern.svg');background-size:auto,190px;color:#fff0c9;border-right:1px solid #c6ab68;padding:8px 8px;border-radius:0 15px 15px 0}
#pustakaSidebar .sidebar-collapse{background:#ffffff15;border:1px solid #d6bb734a;color:#f6df9c}
#pustakaSidebar nav>button{color:#f8f1d8;font-weight:600;font-size:14px;transition:background .15s}
#pustakaSidebar nav>button:hover{background:#ffffff17}
#pustakaSidebar nav>button.active{background:linear-gradient(110deg,#e8d59d,#f3e7bf);color:#124833;box-shadow:0 2px 5px #00190c25}
#pustakaSidebar svg{stroke:currentColor}
#pustakaSidebar .sidebar-label{color:#c6d5b8;border-top-color:#dfc68235;font-size:12px;letter-spacing:1.5px}
body.exploring #sceneViewport{box-shadow:0 0 0 1px #bda97155;border-radius:14px}
body.exploring #pustakaStatus{min-height:41px;padding:4px 9px;background:linear-gradient(100deg,#f9f3df,#e9eedb);border:1px solid #c7b781;box-shadow:0 2px 6px #26432b15;gap:8px}
#pustakaStatus #journeyBar{flex:1 1 auto;overflow:hidden;min-width:0}
#pustakaStatus #journeyBar strong{overflow:hidden;text-overflow:ellipsis}
#pustakaStatus #emojiTray,#pustakaStatus #actionTray{position:relative!important;inset:auto!important;display:flex;align-items:center;flex:0 0 auto!important;width:auto!important;min-width:0!important;padding:0!important;margin:0!important;overflow:visible!important}
#pustakaStatus #emojiToggle,#pustakaStatus #actionToggle{display:inline-flex!important;align-items:center;justify-content:center;gap:5px;width:max-content!important;min-width:max-content!important;max-width:none!important;height:31px!important;min-height:31px!important;padding:5px 10px!important;font:600 14px/1.2 'Segoe UI',Arial,sans-serif!important;white-space:nowrap;box-sizing:border-box;background:#fffdf2;border:1px solid #b6c5a3;border-radius:9px;flex:none;overflow:visible}
#pustakaStatus #emojiChoices,#pustakaStatus #actionChoices{bottom:40px}
.light-talk-circle,.light-talk-circle.inside{width:220px;height:85px;background:#669fe10b;border:2px solid #5694c045;box-shadow:none;pointer-events:none;color:transparent}
.light-hall-banner{object-fit:contain;background:none!important}
.medal-bar{position:relative;display:flex;align-items:center;gap:4px;flex:none;border-left:1px solid #ead18c55;padding-left:10px}
body:not(.exploring) #medalBar{display:none!important}
.medal-icon{display:grid;place-items:center;flex:none;width:34px;height:38px;padding:0;border:0;border-radius:9px;background:transparent;cursor:pointer;color:#fff5d6}
.medal-icon svg{display:block;width:33px;height:33px;filter:grayscale(1);opacity:.58;transition:filter .2s,opacity .2s}
.medal-icon.earned svg{filter:none;opacity:1}
.medal-icon:hover,.medal-icon:focus-visible{background:#fff7d61c;outline:1px solid #e5c56d}
.medal-tooltip{position:absolute;top:calc(100% + 12px);right:0;z-index:35;width:235px;max-width:calc(100vw - 24px);padding:14px 16px;box-sizing:border-box;display:flex;flex-direction:column;gap:6px;text-align:left;white-space:normal;background:#fff9e7;color:#0c4736;border:1px solid #d1ab4a;border-radius:14px;box-shadow:0 7px 24px #123a3030;font:400 14px/1.4 'Segoe UI',Arial,sans-serif}
.medal-tooltip strong{font-size:17px}.medal-tooltip small{font-size:13px;color:#5a6e4f}
.achievement-medal{display:grid;place-items:center;width:100%;height:100px}.achievement-medal svg{width:95px;height:95px}.badge-item.locked .achievement-medal svg{filter:grayscale(1);opacity:.5}
@media(max-width:1100px){body.exploring .site-header .brand>span{font-size:18px}body:not(.exploring) #welcomeContent{width:78vw;gap:12px}body:not(.exploring) #intro{padding:20px max(76px,14%) 23px}.welcome-character{height:108%;max-height:330px}.welcome-character.boy{left:-12%}.welcome-character.girl{right:-12%}#welcomeStations .welcome-station{min-height:74px;font-size:14px}}
@media(max-width:860px){body.exploring .site-header .brand>span{display:none!important}body.exploring .site-header .brand{flex:1;min-width:28px}.medal-bar{padding-left:6px;gap:1px}.medal-icon{width:30px;height:34px}.medal-icon svg{width:29px;height:29px}}
@media(max-width:600px) and (orientation:portrait){
 body:not(.exploring) .site-header{inset:10px 10px auto;height:52px;justify-content:flex-start;gap:6px}
 body:not(.exploring) .site-header .brand{height:49px;padding:5px 9px;max-width:none;border-radius:16px}
 body:not(.exploring) .site-header .brand-logo-full{width:158px;height:38px}
 body:not(.exploring) .site-header .welcome-gema-logo{width:58px;height:49px;padding:4px;border-radius:15px}
 body:not(.exploring) .site-header #musicDock{height:38px;top:5px!important;padding:0 3px}body:not(.exploring) #musicToggle{font-size:14px!important;padding:5px!important}
 body:not(.exploring) #welcomeContent{inset:23% 12px 8%;width:auto;transform:none;gap:12px}
 body:not(.exploring) #intro{padding:93px 16px 20px;border-radius:30px}
 .welcome-character{height:130px;max-height:none;bottom:auto;top:-37px;opacity:1}
 .welcome-character.boy{left:8px}.welcome-character.girl{right:8px}
 body:not(.exploring) #intro .eyebrow{position:relative;z-index:3;font-size:11px;letter-spacing:1.8px;padding:7px 10px;margin-bottom:12px}
 body:not(.exploring) #intro h1{font-size:clamp(30px,8.7vw,39px);margin-bottom:13px;letter-spacing:-.6px}
 body:not(.exploring) #intro .intro-copy{font-size:15px;margin-bottom:16px}
 body:not(.exploring) #intro .intro-actions .button{font-size:15px!important;min-height:45px!important}
 #welcomeStations{gap:6px}#welcomeStations .welcome-station{font-size:11px;min-height:75px;padding:8px 3px;border-radius:14px;gap:6px}#welcomeStations svg{width:25px;height:25px}
 body:not(.exploring) #welcomeFooter{font-size:12px;height:24px;justify-content:center}
 body.exploring .site-header{padding:5px 7px;gap:5px}body.exploring .site-header .brand-logo{width:30px!important;height:32px!important}
 body.exploring .site-header #musicDock,body.exploring .site-header #logoutButton,body.exploring .site-header #menuToggle{font-size:12px;padding:5px 7px;height:33px}
 body.exploring .site-header #musicToggle{font-size:12px!important;padding:4px 5px!important}body.exploring .site-header #musicMore{font-size:15px;padding:2px}
 .medal-bar{gap:0;padding-left:3px}.medal-icon{width:26px;height:31px}.medal-icon svg{width:25px;height:25px}
 #pustakaStatus #journeyStatus{display:none}#pustakaStatus #journeyBar strong{font-size:12px}#pustakaStatus #emojiToggle,#pustakaStatus #actionToggle{font-size:12px!important;padding:4px 7px!important}
 #teacherChoice .teacher-login-form{gap:11px;padding:6px 0}#teacherChoice .teacher-portrait{height:120px}
}
@media(max-height:560px) and (orientation:landscape){
 body:not(.exploring) .site-header{inset:6px 12px auto;height:40px;gap:7px}
 body:not(.exploring) .site-header .brand{height:39px;padding:3px 12px}
 body:not(.exploring) .site-header .brand-logo-full{height:32px;width:185px}
 body:not(.exploring) .site-header .welcome-gema-logo{height:39px;width:68px;padding:3px 5px;border-radius:15px}
 body:not(.exploring) #welcomeContent{top:24%;bottom:9%;width:77vw;gap:7px}
 body:not(.exploring) #intro{padding:10px max(60px,14%) 12px;border-radius:28px}
 body:not(.exploring) #intro h1{font-size:min(4.5vw,7dvh);margin-bottom:7px}
 body:not(.exploring) #intro .eyebrow{font-size:11px;padding:5px 12px;margin-bottom:6px}
 body:not(.exploring) #intro .intro-copy{font-size:13px;line-height:1.25;margin-bottom:9px}
 body:not(.exploring) #intro .intro-actions .button{font-size:14px!important;min-height:34px!important;padding:8px!important}
 .welcome-character{height:115%;max-height:220px;bottom:-5px}.welcome-character.boy{left:-12%}.welcome-character.girl{right:-12%}
 #welcomeStations .welcome-station{min-height:49px;font-size:11px;gap:3px;padding:4px;border-radius:14px}#welcomeStations svg{width:21px;height:20px}
 body:not(.exploring) #welcomeFooter{font-size:12px;height:22px;bottom:1px}
 #teacherChoice .teacher-login-form{gap:7px;padding:0 35px;overflow:auto}#teacherChoice .teacher-portrait{height:54px}
 #accessDialog #teacherChoice h2{font-size:25px}#teacherChoice .teacher-login-form>p{font-size:14px}
 #teacherChoice #accessKey,#teacherChoice #accessServer{min-height:34px;padding:7px;margin-top:3px}#teacherChoice #teacherLogin{min-height:35px;font-size:16px;padding:8px}
 #teacherChoice .connection-settings{padding:7px 10px;font-size:14px}
}
@media(max-width:600px) and (max-height:690px) and (orientation:portrait){body:not(.exploring) #welcomeContent{top:24%;bottom:6%;gap:8px}body:not(.exploring) #intro{padding-top:60px;padding-bottom:15px}.welcome-character{height:105px;top:-42px}body:not(.exploring) #intro h1{font-size:29px}body:not(.exploring) #intro .intro-copy{font-size:14px;margin-bottom:11px}#welcomeStations .welcome-station{min-height:63px}}
body.short-viewport #teacherChoice .teacher-portrait{display:none}body.short-viewport #teacherChoice .teacher-login-form{gap:7px}
@media(prefers-reduced-motion:reduce){.medal-icon svg,#pustakaSidebar nav>button{transition:none}}
/* Keep the two welcome logos together and readable. */
body:not(.exploring) .site-header .session-tools{display:none!important}
body:not(.exploring) .site-header .brand{flex:0 0 auto;margin:0;height:82px}
body:not(.exploring) .site-header .brand-logo-full{width:245px;height:70px}
body:not(.exploring) .site-header .welcome-gema-logo{height:82px;width:106px}
@media(max-width:600px) and (orientation:portrait){body:not(.exploring) .site-header .brand{height:52px}body:not(.exploring) .site-header .brand-logo-full{width:158px;height:42px}body:not(.exploring) .site-header .welcome-gema-logo{height:52px;width:58px}}
@media(max-height:560px) and (orientation:landscape){body:not(.exploring) .site-header .brand{height:43px}body:not(.exploring) .site-header .brand-logo-full{width:185px;height:35px}body:not(.exploring) .site-header .welcome-gema-logo{height:43px;width:68px}}

.medal-tooltip{position:fixed;right:auto;top:auto}
body.exploring .site-header #logoutButton,body.exploring .site-header #menuToggle{flex:none;width:auto!important;min-width:max-content!important;white-space:nowrap;overflow:visible}
/* Connected-room tools get their own compact row on narrow screens. */
@media(max-width:1100px){body.exploring .site-header:has(.session-tools button:not([hidden])) .brand>span{display:none!important}}
@media(max-width:860px){
 body.exploring:has(.session-tools button:not([hidden])){--pustaka-header:90px}
 body.exploring .site-header:has(.session-tools button:not([hidden])){flex-wrap:wrap;align-content:center;row-gap:5px}
 body.exploring .site-header:has(.session-tools button:not([hidden])) .session-tools{order:10;flex:1 0 100%;height:28px;margin:0;justify-content:flex-end;gap:5px}
 body.exploring .site-header .session-tools button{width:29px;min-width:29px;height:28px;min-height:28px;padding:3px;font-size:15px}
}
