/* Mobile 32: gameplay-first HUD. Desktop and video keep their original layout. */
#gMobileFocus{display:none}
@media (max-width:759px), (pointer:coarse) and (max-height:540px){
 :root{--gp-pad:8px;--gp-top:max(8px,env(safe-area-inset-top));--gp-bottom:max(8px,env(safe-area-inset-bottom));--gp-btn:44px;--gp-joy:clamp(84px,24vw,110px)}
 html,body{height:100%;overscroll-behavior:none}#map{height:100vh;height:100dvh;width:100vw}
 body:not(.video) .ui button,body:not(.video) #onlineStatus{touch-action:manipulation}
 body.jogando #hud .brand{display:none}body.jogando #hud{inset:auto;top:0;left:0;width:0;height:0}
 body.jogando #hud .pop{position:fixed;top:calc(var(--gp-top) + 49px);left:106px;right:auto;padding:3px 6px;border:1px solid #567184;border-radius:6px;box-shadow:none;display:flex;gap:4px;align-items:center;white-space:nowrap}
 body.jogando #hud .pop b{font:700 13px/1.25 var(--body)}body.jogando #hud .pop small{font:10px/1.15 var(--body)}
 body.jogando #gTop{top:var(--gp-top);left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));height:42px;gap:4px;display:flex;overflow:visible;align-items:stretch}
 body.jogando #gTop>*{box-shadow:none;border:1px solid #4c677d;border-radius:8px;min-width:0;padding:5px 7px;line-height:1.1;background:#102b42ed;font:600 13px var(--body)}
 body.jogando #gTop #gEu{flex:1;min-width:0;font-size:13px;overflow:hidden;white-space:nowrap}
 body.jogando #gTop :is(#gRank,#gQuest,#gMiss){flex:none;min-width:40px;max-width:68px;padding:4px;font-size:12px}
 body.jogando #gTop :is(#gAlbum,#gRoleta),body.jogando #gTop>span{display:none!important}
 body.jogando #onlineStatus{top:calc(var(--gp-top) + 49px)!important;left:max(8px,env(safe-area-inset-left))!important;height:28px;padding:3px 7px!important;max-width:95px!important;font:600 11px/1.15 system-ui,sans-serif!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:6px!important}
 body.jogando #gMobileFocus{display:block;position:fixed;top:calc(var(--gp-top) + 45px);right:80px;width:40px;height:36px;padding:0;border:1px solid #57758b;border-radius:8px;background:#102b42ed;color:#FFD166;font:700 19px system-ui;z-index:8}
 body.jogando #gExplore{top:calc(var(--gp-top) + 84px);left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));gap:6px;align-items:flex-start}
 body.jogando #gCol{max-width:calc(100% - 74px);width:calc(100% - 74px);gap:4px}
 body.jogando #gExplore button{border:1px solid #567184;border-radius:8px;box-shadow:0 2px 5px #07142144}
 body.jogando #gTarget{width:100%;padding:5px 8px;gap:2px;text-align:left;background:#102b42ed;min-height:42px}
 body.jogando #gTarget>small:first-child{display:none}
 body.jogando #gTarget b{font:600 12px/1.2 system-ui,sans-serif;-webkit-line-clamp:1}
 body.jogando #gTargetDistance{font:10px/1.2 system-ui,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
 body.jogando #gEvento{width:100%;min-height:30px;padding:4px 7px;gap:5px;animation:none}
 body.jogando #gEvento[hidden]{display:none}
 body.jogando #gEvIco{font-size:15px}body.jogando #gEvento>span:last-child{min-width:0;flex:1}body.jogando #gEvNome{font:600 11px/1.2 system-ui,sans-serif;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body.jogando #gEvInfo{display:none}
 body.jogando #gMini{position:fixed;right:max(8px,env(safe-area-inset-right));top:calc(var(--gp-top) + 49px);width:64px;padding:3px;gap:2px;background:#102b42ed}
 body.jogando #gMiniCanvas{width:56px;height:48px}body.jogando #gPlace{width:56px;font-size:9px;line-height:1.25}
 body.jogando #gBusQuick{display:none}
 body.jogando.gp-focus #gCol{display:none}
 body.jogando #gActs{right:max(8px,env(safe-area-inset-right));bottom:var(--gp-bottom);grid-template-columns:repeat(2,var(--gp-btn));grid-template-rows:repeat(2,var(--gp-btn));gap:6px;direction:ltr}
 body.jogando #gActs button{width:var(--gp-btn);height:var(--gp-btn);font-size:20px;border:1px solid #60778b;border-radius:10px;background:#102b42ee;box-shadow:0 2px 5px #05132177}
 body.jogando #gActs #gChat{grid-area:1/1}body.jogando #gActs #gGestos{grid-area:1/2}body.jogando #gActs #gCorrer{grid-area:2/1}body.jogando #gActs #gMenu{grid-area:2/2}
 body.jogando #gActs :is(#gMochila,#gVisual,#gFoto,#gViajar,#gSair){display:none}
 body.jogando #gActs button.on{background:#FFD166;color:#172637}
 body.jogando #joy{display:block;width:var(--gp-joy);height:var(--gp-joy);left:max(12px,env(safe-area-inset-left));bottom:var(--gp-bottom);border:2px solid #a2bed061;background:#10273a6b;box-shadow:none}
 body.jogando #joy i{width:40%;height:40%;left:30%;top:30%;border:2px solid #c7a057;background:#FFD166;box-shadow:0 2px 3px #10273a80}
 body.jogando #gFalar{bottom:calc(var(--gp-bottom) + max(var(--gp-joy),94px) + 9px);width:max-content;max-width:calc(100vw - 28px);min-height:44px;border:1px solid #a27a35;border-radius:10px;padding:7px 12px;font:600 13px/1.25 system-ui,sans-serif;box-shadow:0 2px 5px #14283a80;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
 body.jogando #gFalar[hidden]{display:none}
 body.jogando #gBico{bottom:calc(var(--gp-bottom) + max(var(--gp-joy),94px) + 9px);left:8px;max-width:calc(100vw - 16px);min-height:32px;border:1px solid #a27a35;border-radius:7px;font:12px/1.2 system-ui,sans-serif}
 body.jogando:has(#gFalar:not([hidden])) #gBico{bottom:calc(var(--gp-bottom) + max(var(--gp-joy),94px) + 66px)}
 body.jogando #gGestosPanel{right:8px;bottom:calc(var(--gp-bottom) + 102px);width:min(250px,calc(100vw - 16px));z-index:12}
 body.jogando #toast{top:auto!important;bottom:calc(var(--gp-bottom) + max(var(--gp-joy),94px) + 66px);left:50%;max-width:calc(100vw - 24px);width:max-content;font:12px/1.3 system-ui,sans-serif;pointer-events:none}
 body.jogando #ganhos{top:calc(var(--gp-top) + 165px)!important;max-width:50vw}
 body.jogando #banner{min-width:0;max-width:calc(100vw - 24px);width:max-content;padding:8px 12px}
 body.jogando #banner b{font:700 14px/1.3 var(--body)}body.jogando #banner small{font-size:12px}
 body.jogando #dlg{bottom:calc(var(--gp-bottom) + max(var(--gp-joy),94px) + 8px);border-radius:9px;padding:8px;gap:6px;max-height:35dvh;overflow:auto}
 #dlg img{width:34px;height:51px}#dlg p{font:13px/1.35 system-ui,sans-serif}#dlg b{font:600 12px/1.2 system-ui,sans-serif;overflow-wrap:anywhere}
 body.jogando #gpCarPanel{bottom:calc(var(--gp-bottom) + max(var(--gp-joy),94px) + 10px)!important;left:8px!important;padding:4px 7px!important;min-width:80px!important;max-width:110px!important;font-size:10px!important;z-index:5!important}
 body.jogando #gpCarPanel>div:first-child{display:none}body.jogando #gpCarPanel>div:nth-child(3){font-size:18px!important}
 body.jogando:has(#gFalar:not([hidden])) #gpCarPanel{bottom:calc(var(--gp-bottom) + max(var(--gp-joy),94px) + 65px)!important}
 #polRadio,#polHud{top:calc(var(--gp-top) + 84px)!important;width:calc(100% - 16px);max-width:380px;font-size:13px;padding:8px}
 body:has(#polRadio) #gCol,body:has(#polHud) #gCol{visibility:hidden}
 #polRadio .prb button{min-height:44px}#polRadio p{min-height:0}
 #sheet:not(.hidden){left:max(6px,env(safe-area-inset-left));right:max(6px,env(safe-area-inset-right));width:auto;top:auto;bottom:calc(var(--gp-bottom) + 4px);max-height:min(86dvh,calc(var(--gp-visible-h,100vh) - 18px));border-radius:14px 14px 9px 9px;border:1px solid #54738a;box-shadow:0 8px 32px #06132299}
 #sheetBody{padding:14px 12px 18px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;font:14px/1.4 system-ui,sans-serif}
 #sheetBody h2{font:700 18px/1.25 var(--body);margin:3px 48px 12px 0}#sheetBody h3{font:700 15px/1.35 var(--body)}
 #sheetClose{width:44px;height:44px;border:1px solid #b14a52;border-radius:9px}
 #sheetBody :is(.btn,.tag,.row,.activity, .gameMenu button){min-height:44px;max-width:100%;overflow-wrap:anywhere}
 #sheetBody :is(input,textarea,select){font-size:16px;max-width:100%}
 #sheetBody .gameMenu{gap:6px}#sheetBody .gameMenu button{min-height:62px;border-radius:8px;border:1px solid #38536e;gap:4px;padding:7px}#sheetBody .gameMenu b{font:600 12px/1.2 system-ui,sans-serif}
 #sheetBody canvas,#sheetBody img{max-width:100%}#sheetBody .avedit{min-width:0}#sheetBody .avopts{min-width:0}
 #mg{padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));overflow:auto;overscroll-behavior:contain}
 #mg .mgbox{width:min(100%,460px);max-width:100%;max-height:calc(var(--gp-visible-h,100vh) - 16px);overflow:auto;overscroll-behavior:contain;border-radius:10px}
 #mg button:not(.mgx){min-height:40px}#mg .mgx{min-width:40px;min-height:40px}
 #mg canvas{max-width:100%;object-fit:contain}#mg .docs{grid-template-columns:1fr}
 #chatBox{left:8px;right:8px;max-width:none;bottom:calc(var(--gp-bottom) + var(--keyboard,0px));max-height:min(65dvh,calc(var(--gp-visible-h,100vh) - 20px));border-radius:12px}
 #chatForm input{font-size:16px}#chatForm button{min-height:44px}
 body.chat-open #gMobileFocus,body:has(#mg) #gpCarPanel,body:has(#sheet:not(.hidden)) #gpCarPanel{visibility:hidden;pointer-events:none}
}
@media(max-width:350px){
 body.jogando #hud .pop small{display:none}body.jogando #gTop #gEu{font-size:12px}
 body.jogando #gTop :is(#gRank,#gQuest,#gMiss){min-width:37px;padding:3px;font-size:11px}
 #sheetBody .gameMenu b{font-size:11px}
}
@media (max-height:480px) and (orientation:landscape) and (pointer:coarse){
 :root{--gp-joy:78px;--gp-btn:40px}
 body.jogando #gTop{right:auto;width:min(300px,48vw);height:38px}
 body.jogando #gMobileFocus{top:var(--gp-top);right:80px}
 body.jogando #gMini{top:var(--gp-top)}
 body.jogando #gExplore{top:calc(var(--gp-top) + 78px);right:auto;width:245px}
 body.jogando #gCol{width:100%;max-width:100%}
 body.jogando #gEvento{min-height:26px}
 body.jogando #gFalar{bottom:var(--gp-bottom);max-width:calc(100vw - 220px)}
 body.jogando #gBico{bottom:calc(var(--gp-bottom) + 50px)}
 body.jogando:has(#gFalar:not([hidden])) #gBico{bottom:calc(var(--gp-bottom) + 50px)}
 body.jogando #gGestosPanel{right:96px;bottom:var(--gp-bottom)}
 body.jogando #dlg{bottom:calc(var(--gp-bottom) + 4px);left:94px;right:100px;max-height:52dvh}
 body.jogando #gpCarPanel{bottom:calc(var(--gp-bottom) + 88px)!important}
 body.jogando #polRadio,body.jogando #polHud{top:calc(var(--gp-top) + 45px)!important;max-width:320px}
 #sheet:not(.hidden){max-height:calc(var(--gp-visible-h,100vh) - 16px)}
}

body.jogando #gCorrer[data-driving="true"]{touch-action:manipulation;min-height:44px}

/* Activity controls stay reachable when the phone rotates. */
#mg.mgActivity .mgbox {
  max-height: calc(var(--gp-visible-h, 100vh) - 20px);
  overflow: auto;
  overscroll-behavior: contain;
}
#mg.mgActivity :is(.mgPause, .mgGate, .mgx) {
  border: 1px solid #64869c;
  border-radius: 9px;
  background: #173552;
  color: #f1f8fb;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  font: 700 13px system-ui, sans-serif;
}
#mg.mgActivity .mghead { gap: 6px; }
#mg.mgActivity .mghead b { flex: 1; }
#mg.mgActivity .mgGate { width: 100%; background: #ffdb82; color: #142338; }
#mg.mgActivity[data-phase="ready"] .mgbtn,
#mg.mgActivity[data-phase="paused"] .mgbtn { display: none; }
#mg.mgActivity[data-phase="paused"] canvas { opacity: .46; }
#mg.mgActivity :is(button, canvas):focus-visible { outline: 2px solid #fff2b3; outline-offset: -3px; }
#mg.mgActivity[data-phase="result"] .mgmsg { border-left: 3px solid #8de9cc; padding-left: 9px; }
.graphics-light #mg:not(.gotham):not(.pol) { backdrop-filter: none; background: #0b1729ef; }
@media (orientation: landscape) and (max-height: 460px) {
  #mg.mgActivity .mgbox { width: min(640px, 100%); display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(135px, 1fr); gap: 6px 12px; align-items: start; }
  #mg.mgActivity .mghead { grid-column: 1 / -1; margin: 0; }
  #mg.mgActivity canvas { grid-row: 2 / span 3; grid-column: 1; }
  #mg.mgActivity :is(.mgmsg, .mgbtn, .mgGate) { grid-column: 2; margin: 0; }
}

#mg.pol .polres .carimbo {
  max-width: 95%;
  font-size: clamp(16px, 5vw, 28px);
  padding: 5px 12px;
  text-align: center;
  animation: carimbo-movel .28s ease-out both;
}
@keyframes carimbo-movel {
  from { transform: rotate(-3deg) scale(.94); opacity: .4; }
  to { transform: rotate(-3deg) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #mg.pol .polres .carimbo { animation: none; }
}

.quickVisit { display:grid; gap:8px; margin: 12px 0; }
.quickVisit label, .qloginDetails summary { font: 700 15px/1.35 system-ui,sans-serif; }
.quickVisit input { width:100%; min-height:44px; font:16px system-ui,sans-serif; padding:8px; }
.qloginDetails summary { min-height:44px; cursor:pointer; padding:12px 0; }
#gInteractions { position:fixed; z-index:6; left:50%; translate:-50% 0; bottom:calc(150px + var(--bot)); display:flex; align-items:stretch; gap:6px; width:max-content; max-width:calc(100vw - 24px); }
body.jogando #gInteractions #gFalar { position:static; translate:none; bottom:auto; min-width:0; max-width:min(74vw,360px); min-height:44px; }
#gMore { min-width:44px; min-height:44px; border-radius:10px; background:#173552; color:white; border:1px solid #7896a4; font:700 24px system-ui,sans-serif; }
body.chat-open #gInteractions,body:has(#sheet:not(.hidden)) #gInteractions { visibility:hidden; pointer-events:none; }
#gpActivityResults .activity[disabled], .festival .activity[disabled] { opacity:.62; }
@media (max-width:759px), (pointer:coarse) {
 body.jogando #gInteractions { bottom:calc(var(--gp-bottom) + max(var(--gp-joy),94px) + 9px); }
 body.jogando.joy-right #joy { left:auto; right:max(12px,env(safe-area-inset-right)); }
 body.jogando.joy-right #gActs { left:max(8px,env(safe-area-inset-left)); right:auto; }
}
@media (orientation:landscape) and (max-height:480px) {
 body.jogando #gInteractions { bottom:var(--gp-bottom); max-width:calc(100vw - 230px); }
}
#mg .mgMode { font:600 13px/1.4 system-ui,sans-serif; display:grid; gap:4px; margin-bottom:6px; }
#mg .mgMode select { min-height:44px; font:inherit; border-radius:8px; padding:5px 8px; background:#173552; color:#fff; }
#mg:not([data-phase="ready"]) .mgMode { display:none; }
#mg .mgRetry { margin-bottom:6px; }
@media (orientation:landscape) and (max-height:460px) { #mg .mgMode { grid-column:2; } }

/* Aviação. Os comandos físicos acompanham o placar em retrato e paisagem. */
#mg.aviationActivity .mgbox { border-color:#66999d; background:#102d45; }
#mg.aviationActivity .mgmsg { min-height: 2.8em; }
#mg.aviationActivity .airControls { display:flex; gap:5px; width:100%; }
#mg.aviationActivity .airControls:empty,
#mg.aviationActivity:not([data-phase="play"]) .airControls,
#mg.aviationActivity:not([data-phase="result"]) .mgbtn { display:none; }
.airControls button {
  flex:1; min-width:0; min-height:50px; padding:4px 3px;
  border:2px solid var(--air-key); border-radius:8px; background:#14364e; color:#f7f3e4;
  font:700 13px system-ui,sans-serif; touch-action:none;
}
.airControls button:active { background:var(--air-key); color:#102837; }
@media (orientation:landscape) and (max-height:460px) {
  #mg.aviationActivity .airControls { grid-column:2; }
}
#sheet.aeroporto .airHero {
  padding:14px; border:1px solid #678b9c; border-radius:10px; margin-bottom:12px;
  background:linear-gradient(152deg,#186b72,#152e4a 68%); color:#fff1d1;
}
.airHero small { display:block; margin-top:5px; color:#bce6dc; }
.airCard { padding:9px 0; border-top:1px solid #71899f55; }
.airCard h3 { margin:3px 0; }
.airCard p { margin:5px 0 8px; }
.airCard button { min-height:44px; }

body.video #onlineStatus { display:none; }

#sheet.aeroporto .airBoard {
  display:flex; justify-content:space-between; align-items:center; gap:8px;
  padding:8px 10px; margin:8px 0; background:#132b42; border:1px solid #53738c;
  border-radius:8px; color:#e4f4f0; font-size:.85rem;
}
.airBoard time { color:#ffd68b; text-align:right; }
.airActions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.airActions .btn { min-height:44px; margin:0; }
.airFlightProfile { display:flex; gap:8px; align-items:center; }
.airFlightProfile canvas { flex:none; background:#174657; border-radius:8px; image-rendering:pixelated; }
#mg.freeFlight .airControls { display:flex; gap:5px; }
#mg.freeFlight:not([data-phase="play"]) .airControls { display:none; }
#mg.aviationActivity .airRequestHelp,
#mg.aviationActivity .towerControls button {
  min-height:44px; background:#173951; color:#f2f6e7; font:700 12px system-ui,sans-serif;
  border-radius:7px; border:1px solid #6c93a9; padding:4px 5px;
}
#mg.aviationActivity:not([data-phase="play"]) :is(.airRequestHelp,.towerControls) { display:none; }
.towerTickets,.towerWindows { display:grid; gap:5px; margin:4px 0; }
.towerTickets { grid-template-columns:repeat(2,minmax(0,1fr)); }
.towerWindows { grid-template-columns:repeat(6,minmax(0,1fr)); }
#mg.towerActivity button:is([aria-pressed="true"],.reserved) { background:#1b615e; color:#fff0bc; border-color:#b1e5d2; }
#mg.towerActivity button:disabled { opacity:.64; }
@media (orientation:landscape) and (max-height:460px) {
  #mg.aviationActivity :is(.airRequestHelp,.towerControls), #mg.freeFlight .airControls { grid-column:2; }
}

body.dentroAeroporto #gEvento, body.dentroAeroporto #gMini { display:none; }

#mg.freeFlight .flightTurn { font-size:22px; }


.trafficPractice { display:block; padding:8px 0; }
#mg.trafficActivity .trafficStatus { margin:0; font:700 13px/1.2 system-ui,sans-serif; color:#ffeda8; }
#mg.trafficActivity .mgmsg { min-height:2.3em; }
#mg.trafficActivity .trafficQueue { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
#mg.trafficActivity .trafficQueue :is([hidden],:empty) { display:none; }
#mg.trafficActivity .trafficFlight {
  min-width:0; min-height:44px; background:#17394c; color:#f6f1df; padding:3px 4px;
  border:1px solid #74a0a3; border-radius:6px; font:700 12px/1.12 system-ui,sans-serif;
}
#mg.trafficActivity .trafficFlight small { display:block; font-size:11px; }
#mg.trafficActivity .trafficFlight[aria-pressed="true"] { background:#25565b; border-color:#ffcb77; color:#fff3c9; }
#mg.trafficActivity .trafficFlight:is(.short,.priority) small { color:#ffdb92; }
#mg.trafficActivity .trafficActions { display:flex; gap:6px; }
#mg.trafficActivity .trafficActions > :is(.mgbtn,.mgGate,.trafficReserve) { flex:1; min-width:0; min-height:44px; padding:6px; margin:0; font:800 13px/1.15 system-ui,sans-serif; overflow-wrap:anywhere; }
#mg.trafficActivity .trafficReserve[hidden],
#mg.trafficActivity .trafficActions[hidden],
#mg.trafficActivity:not([data-phase="play"]) :is(.trafficStatus,.trafficQueue,.trafficReserve),
#mg.trafficActivity:is([data-phase="ready"],[data-phase="paused"]) .trafficActions { display:none; }
#mg.trafficActivity :is(.trafficReserve,.trafficActions .mgbtn):disabled { opacity:.55; }
@media (orientation:landscape) and (max-height:460px) {
  #mg.trafficActivity canvas { grid-row:2 / span 6; }
  #mg.trafficActivity :is(.trafficStatus,.trafficQueue,.trafficActions) { grid-column:2; }
}
