/* Phone layout uses CSS pixels for tap targets, independent of the game canvas. */
#game,#game *,#orientationGate,#orientationGate *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
#game input,#game textarea,#game select,#game [contenteditable=true]{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
html[data-mobile=true] #world,html[data-mobile=true] #touch,html[data-mobile=true] #hubTouch{touch-action:none}
#world{-webkit-user-drag:none}
#orientationGate{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:max(24px,env(safe-area-inset-top)) max(22px,env(safe-area-inset-right));background:radial-gradient(ellipse at 50% 35%,#294b58,#091c2c 78%);color:#f6ecd5;text-align:center;overscroll-behavior:none}
#orientationGate[hidden]{display:none}#orientationGate>div{width:min(460px,100%);max-height:100%;overflow:auto}#orientationGate .eyebrow{display:block;color:#e3c38a;font-size:11px}#orientationGate h1{font:600 clamp(25px,6vw,36px)/1.15 GameUI,system-ui,sans-serif;margin:18px 0}#orientationGate p{font:16px/1.6 system-ui,sans-serif;color:#c6dbe0;margin:16px 0 25px}#orientationGate button{display:block;width:100%;min-height:52px;font:600 16px system-ui,sans-serif;margin-top:12px;touch-action:manipulation}#orientationGate button[hidden]{display:none}.orientation-icon{display:grid;place-items:center;margin:0 auto 25px;width:92px;height:62px;border:3px solid #d3b479;border-radius:12px;font:46px/1 system-ui;color:#f3d697;transform:rotate(-10deg)}
html[data-orientation-gate=true] #shell{visibility:hidden}
html[data-mobile=true],html[data-mobile=true] body{height:100%;overscroll-behavior:none;-webkit-text-size-adjust:100%;touch-action:manipulation}
html[data-mobile=true] #shell{height:var(--screen-height,100dvh);background:#091c2b}
html[data-mobile=true] #game{width:100%;height:100%;aspect-ratio:auto;box-shadow:none;background:radial-gradient(ellipse at 50% 46%,#294957,#0a1c2a 75%)}
html[data-mobile=true] #world{position:absolute;width:min(100%,calc((var(--screen-height,100dvh) - 16px)*16/9));height:auto;aspect-ratio:16/9;left:50%;top:50%;transform:translate(-50%,-50%)}
html[data-touch=true] #game{--control-gutter:clamp(96px,12vw,118px)}
html[data-mobile=true][data-touch=true][data-portrait=false] #world{width:min(calc(100% - 2*var(--control-gutter) - env(safe-area-inset-left) - env(safe-area-inset-right)),calc((var(--screen-height,100dvh) - 16px)*16/9))}
#mobileTools{position:absolute;top:max(8px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));display:flex;justify-content:space-between;z-index:8;pointer-events:none}
#mobileTools[hidden]{display:none}#mobileTools a,#fullscreen{pointer-events:auto;display:grid;place-items:center;min-width:44px;min-height:44px;padding:8px;border:1px solid #8aabb267;background:#0c293de8;color:#f1e5bf;border-radius:10px;text-decoration:none;font:14px system-ui,sans-serif}#fullscreen{font-size:27px;line-height:1}
html[data-mobile=true] #pause{right:max(10px,env(safe-area-inset-right));top:62px;width:44px;height:44px;border-radius:10px;z-index:7}
html[data-touch=true] #touch.playing,html[data-touch=true] #hubTouch.playing{display:flex}
html[data-touch=false] #touch,html[data-touch=false] #hubTouch{display:none!important}
html[data-mobile=true] #touch{inset:0;height:auto;padding:0;pointer-events:none}
html[data-mobile=true] #touch .group{position:absolute;bottom:max(15px,env(safe-area-inset-bottom));gap:10px;display:grid;align-items:center;justify-items:center;pointer-events:none}
html[data-mobile=true] #touch .group:first-child{left:max(8px,env(safe-area-inset-left));grid-template-columns:44px 44px}
html[data-mobile=true] #touch .group:last-child{right:max(14px,env(safe-area-inset-right));grid-template-columns:68px}
html[data-mobile=true] #touch button{position:relative;pointer-events:auto;touch-action:none;min-width:44px;width:44px;min-height:44px;height:52px;border-radius:13px;background:#183b50ef;border:1px solid #91b3bb;box-shadow:0 4px #041422;font-size:23px;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;padding:0}
html[data-mobile=true] #touch button[data-key=run]{grid-column:1/-1;grid-row:1;width:64px;height:44px;font-size:21px;padding-bottom:10px}
html[data-mobile=true] #touch button[data-key=jump]{width:68px;height:66px;background:#e6c181;color:#122d43;padding-bottom:12px}
html[data-mobile=true] #touch button[data-key=ability]{width:52px;height:50px;padding-bottom:10px}
html[data-mobile=true] #touch button[data-key=down]{width:82px;height:44px;font-size:12px}
html[data-mobile=true] #touch button[data-key=jump]:after{content:'Pular'}html[data-mobile=true] #touch button[data-key=ability]:after{content:'Poder'}html[data-mobile=true] #touch button[data-key=run]:after{content:'Correr'}
html[data-mobile=true] #touch button:after{position:absolute;bottom:4px;left:0;right:0;font:10px system-ui,sans-serif;letter-spacing:.2px}
html[data-mobile=true] #touch button.down,html[data-mobile=true] #hubTouch button.down{background:#f0d496;color:#142d40;border-color:#fff0c0;box-shadow:0 1px #071625;transform:translateY(3px)}
html[data-mobile=true] #hubTouch{inset:0;height:auto;pointer-events:none;padding:0}
html[data-mobile=true] #hubTouch .hub-dpad{display:none}
html[data-mobile=true] #hubEnter{position:absolute;right:max(8px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));width:88px;height:50px;border-radius:12px;font-size:14px;padding:8px;pointer-events:auto;touch-action:none}
html[data-mobile=true] #hubButtons{left:max(8px,env(safe-area-inset-left));top:64px;right:auto;flex-direction:column;gap:6px}
html[data-mobile=true] #hubButtons button{min-height:44px;min-width:88px;font-size:12px;padding:8px}
html[data-mobile=true] #hubExtras{left:max(8px,env(safe-area-inset-left));bottom:max(16px,env(safe-area-inset-bottom));right:auto}
html[data-mobile=true] #hubExtras button{min-height:44px;font-size:12px;padding:8px 12px}
html[data-mobile=true] #storyQuick{top:118px;right:max(8px,env(safe-area-inset-right));bottom:auto;font-size:11px;padding:8px;min-height:44px;max-width:88px}
html[data-mobile=true] #travelNote{top:18%;left:20%;max-width:60%;font-size:12px}
html[data-mobile=true] #toast{max-width:75%;white-space:normal;text-align:center;font:13px/1.5 system-ui,sans-serif;top:16%;padding:9px 12px}
#mobileStatus,#mobileHint{display:none}
html[data-mobile=true] .overlay{padding:60px max(18px,env(safe-area-inset-left)) 14px;overflow:auto;align-items:safe center;backdrop-filter:none}
html[data-mobile=true] .overlay:empty{display:none}
html[data-mobile=true] .panel,html[data-mobile=true] .settings,html[data-mobile=true] .storybox{max-height:100%;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
html[data-mobile=true] .primary,html[data-mobile=true] .secondary,html[data-mobile=true] .link{min-height:44px;font-size:14px;padding:10px 16px}
html[data-mobile=true] .eyebrow{font-size:10px;letter-spacing:.1em}
html[data-mobile=true] .settings{width:min(560px,100%);padding:20px}
html[data-mobile=true] .settings p{font-size:13px;line-height:1.65}
html[data-mobile=true] .settings h2{font-size:24px}
html[data-mobile=true] .setting{min-height:48px;font-size:14px;gap:12px}
html[data-mobile=true] input[type=range]{min-height:36px}
html[data-mobile=true] .start-menu{position:relative;inset:auto;padding:14px 22px;max-height:100%;overflow:auto;width:100%;background:#0b263dcc;border-radius:12px}
html[data-mobile=true] .title-screen h1{font-size:clamp(28px,5vw,44px);margin:14px 0;line-height:1.1}
html[data-mobile=true] .title-screen p{font-size:14px;max-width:100%!important;line-height:1.65;margin-bottom:14px}
html[data-mobile=true] .title-meta{position:static;margin-top:18px;font-size:10px;line-height:1.7}
html[data-mobile=true] .menu-status{font-size:12px;line-height:1.65}
html[data-mobile=true] .title-tag{display:none}
html[data-mobile=true] .title-screen .actions{max-width:none}
html[data-mobile=true] .saint{min-height:94px}.saint:focus-visible{outline-offset:1px}
html[data-mobile=true] .saint b{font-size:11px}
html[data-mobile=true] .detail h3{font-size:21px}
html[data-mobile=true] .detail p{font-size:14px;line-height:1.6}
html[data-mobile=true] .detail .badge,html[data-mobile=true] .detail .power{font-size:12px}
html[data-mobile=true] .hint{font-size:11px;max-width:none}
html[data-mobile=true] .sub{font-size:13px;line-height:1.6}
html[data-mobile=true] .panel h2{font-size:25px}
html[data-mobile=true] .story-dialog .scene-body p{font-size:15px;line-height:1.6}
html[data-mobile=true] .story-dialog .scene-footer .secondary{display:inline-flex}
html[data-mobile=true] .story-dialog h2{font-size:23px}
html[data-mobile=true] .story-dialog .current-goal strong{font-size:14px}
html[data-mobile=true] .story-receipt{top:12%;max-height:76%;overflow:auto}
html[data-mobile=true] .story-receipt p{font-size:14px}
html[data-mobile=true] .pilgrim-shop{width:100%;max-height:100%}
@media(orientation:portrait){
 html[data-mobile=true] #game{--arena-top:clamp(140px,25vh,240px)}
 html[data-mobile=true] #world{width:100%;top:var(--arena-top);left:0;transform:none}
 html[data-mobile=true][data-camera=close] #world{width:var(--arena-width);height:var(--arena-height);left:var(--portrait-left)}
 html[data-mobile=true] #mobileStatus{position:absolute;top:calc(var(--arena-top) - 76px);left:14px;right:14px;display:none;gap:4px;z-index:1;font:13px/1.4 system-ui,sans-serif;color:#e5eff1}
 html[data-touch=true][data-state=play] #mobileStatus,html[data-touch=true][data-state=victory] #mobileStatus,html[data-touch=true][data-state=defeat] #mobileStatus{display:grid;grid-template-columns:1fr auto}
 #mobileHearts{color:#f78388;font-size:20px;letter-spacing:1px;white-space:nowrap}#mobileLoot{align-self:center;font-size:12px}#mobileObjective{grid-column:1/-1;color:#f7dfac;font-size:14px;min-height:22px}
 html[data-mobile=true] #mobileHint{display:block;position:absolute;top:calc(var(--arena-top) + 100vw*9/16 + 16px);left:16px;right:16px;text-align:center;font:13px/1.6 system-ui,sans-serif;color:#b0cad5;pointer-events:none}
 html[data-mobile=true][data-camera=close] #mobileHint{top:calc(var(--arena-top) + var(--arena-height) + 16px)}
 html[data-mobile=true]:not([data-state=play]):not([data-state=hub]) #mobileHint{display:none}
 html[data-mobile=true][data-state=hub] #mobileHint:after{content:'Toque em um ponto do mapa para escolher a fase.'}
 html[data-mobile=true][data-state=play] #mobileHint:after{content:'Ande com o polegar esquerdo. Pule e use o poder com o direito.'}
 html[data-mobile=true] #touch .group{bottom:max(54px,calc(env(safe-area-inset-bottom) + 32px))}
 html[data-mobile=true] #touch .group:first-child{left:20px;grid-template-columns:56px 56px;gap:10px}
 html[data-mobile=true] #touch .group:last-child{right:23px;grid-template-columns:72px}
 html[data-mobile=true] #touch button{width:56px;height:60px}
 html[data-mobile=true] #touch button[data-key=run]{width:80px;height:48px}
 html[data-mobile=true] #touch button[data-key=jump]{width:72px;height:72px}
 html[data-mobile=true] #touch button[data-key=ability]{width:58px;height:56px}
 html[data-mobile=true] #hubTouch .hub-dpad{position:absolute;left:16px;bottom:max(45px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(3,46px);grid-template-rows:repeat(2,46px);gap:5px}
 html[data-mobile=true] #hubTouch .hub-dpad button{min-width:46px;width:46px;min-height:46px;height:46px;touch-action:none}
 html[data-mobile=true] #hubEnter{right:22px;bottom:max(62px,env(safe-area-inset-bottom));width:100px;height:62px}
 html[data-mobile=true] #hubButtons{top:62px;left:14px;right:auto;flex-direction:row}
 html[data-mobile=true] #hubExtras{left:14px;bottom:auto;top:112px}
 html[data-mobile=true] #storyQuick{top:62px;right:64px;min-height:44px}
 html[data-mobile=true] #travelNote{top:calc(var(--arena-top) + 100vw*9/16 + 47px);left:6%;max-width:88%;font-size:12px}
 html[data-mobile=true] .select-layout{grid-template-columns:1fr;gap:16px}
 html[data-mobile=true] .cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 html[data-mobile=true] .saint canvas{width:52px;max-width:90%;margin-bottom:7px}
 html[data-mobile=true] .detail{padding:15px}
 html[data-mobile=true] .panel-bottom{align-items:stretch;flex-direction:column;gap:12px}
 html[data-mobile=true] .panel-bottom .primary{width:100%}
 html[data-mobile=true] .title-screen h1{font-size:36px}
 html[data-mobile=true] .start-menu .actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
 html[data-mobile=true] .start-menu .actions>.primary{grid-column:1/-1}
 html[data-mobile=true] .start-menu{padding:22px 18px}
 html[data-mobile=true] .story-dialog{width:100%;max-height:100%;padding:18px}
 html[data-mobile=true] .story-dialog .scene-body{grid-template-columns:48px 1fr;gap:12px}
 html[data-mobile=true] .story-dialog .scene-body canvas{width:48px;height:48px}
 html[data-mobile=true] .scene-footer{align-items:stretch;flex-direction:column;gap:12px}
 html[data-mobile=true] .scene-footer .actions{justify-content:stretch}.scene-footer .actions button{flex:1}
 html[data-mobile=true] #rotate{display:block;bottom:max(10px,env(safe-area-inset-bottom));font-size:11px;padding:0 14px}
}
@media(orientation:portrait) and (max-height:740px){html[data-mobile=true] #mobileHint{display:none}}
@media(orientation:landscape) and (max-height:360px){html[data-mobile=true] #storyQuick{top:112px;min-height:38px;font-size:10px}html[data-mobile=true] .overlay{padding-top:56px}html[data-mobile=true] .start-menu{padding:10px 18px}html[data-mobile=true] .title-screen h1{font-size:27px}html[data-mobile=true] .title-screen .eyebrow{font-size:8px}}
