/* Shared controls */
[hidden]{display:none!important}
button{box-sizing:border-box;cursor:pointer}
input,select,textarea{box-sizing:border-box}
button:disabled{cursor:default;opacity:.55}
button:focus-visible,a:focus-visible{outline:2px solid #e7c36d;outline-offset:2px}

/* Brand and language switch */
#topBar #logo{display:flex;align-items:center;justify-content:center;text-decoration:none;color:#231f20;font-weight:700;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
#topBar #logo img{display:block;width:80px;height:80px;object-fit:contain}
#language-toggle{position:absolute;inset-inline-end:12px;top:8px;z-index:50;padding:5px 9px}

/* Account and game navigation */
#account-panel{background:none;border:0;padding:0;box-shadow:none}
body.game-ready.village1 #screen-title,
body.game-ready.village2 #screen-title{display:none}
.game-ready #account-panel>h2,
.game-ready #account-panel>#world-list,
.game-ready #account-panel>#logout,
.game-ready #account-panel>#account-settings{display:none}
.game-ready #village-panel>*{display:none!important}
.game-ready #account-panel>section,
.game-ready #account-panel>#military-panel{display:none!important}
.game-ready[data-screen=resources] #village-panel>#classic-village,
.game-ready[data-screen=village] #village-panel>#classic-village{display:block!important}
.game-ready[data-screen=build] #village-panel>#native-building-page,
.game-ready[data-screen=build] #native-building-page #construction-form:not([hidden]),
.game-ready[data-screen=build] #native-building-page>#native-construction-queue{display:block!important}
.game-ready[data-screen=map] #village-panel>#map-panel:not([hidden]),
.game-ready[data-screen=statistics] #village-panel>#rankings-panel:not([hidden]),
.game-ready[data-screen=hero] #village-panel>#hero-panel:not([hidden]),
.game-ready[data-screen=market] #village-panel>#trade-panel:not([hidden]),
.game-ready[data-screen=market] #village-panel>#market-offers-panel:not([hidden]),
.game-ready[data-screen=alliance] #account-panel>#alliance-panel:not([hidden]){display:block!important}
.game-ready[data-screen=settings] #account-panel>#account-settings,
.game-ready[data-screen=settings] #village-panel>#village-rename-form,
.game-ready[data-screen=settings] #account-panel>#logout{display:block!important}
.game-ready[data-screen=military] #account-panel>#military-panel:not([hidden]),
.game-ready[data-screen=reports] #account-panel>#military-panel:not([hidden]),
.game-ready[data-screen=research] #account-panel>#military-panel:not([hidden]){display:block!important}
.game-ready[data-screen=research] #account-panel>#military-panel>*{display:none!important}
.game-ready[data-screen=research] #account-panel>#military-panel>#research-panel:not([hidden]){display:block!important}
.game-ready[data-screen=reports] #military-panel>*{display:none!important}
.game-ready[data-screen=reports] #military-panel>#combat-panel{display:block!important}
.game-ready[data-screen=reports] #combat-panel>h3,
.game-ready[data-screen=reports] #combat-form{display:none!important}
.game-ready:not([data-screen=reports]) #combat-reports{display:none}
.village-view-tabs{display:none}
body:not(.login) #contentOuterContainer #content{min-height:370px}
#stockBar .capacity .value{font-size:11px}
#stockBar .stockBarButton .value{font-size:11px;position:relative;z-index:2}
body.login #navigation,
body.login #sidebarBeforeContent,
body.login #sidebarAfterContent,
body.login #stockBar{display:none!important}
body:not(.game-ready) #sidebarBeforeContent,
body:not(.game-ready) #sidebarAfterContent{visibility:hidden}
body:not(.game-ready) #account-panel>section{display:none}
.game-ready[data-screen=messages] #village-panel>#player-messages-panel:not([hidden]){display:block!important}

/* Village scene */
#classic-village{margin:0;padding:0;border:0;background:none;min-height:0}
.classic-scene-scroll{overflow:visible;position:relative}
.classic-scene{position:relative;margin:0 auto;isolation:isolate;background-repeat:no-repeat}
.classic-building-hitarea{position:absolute;inset:0;z-index:2;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;pointer-events:auto}
.classic-building-hitarea img{max-width:none;max-height:none;pointer-events:none}
.classic-building-hitarea .level{pointer-events:auto}
#classic-selection{padding:8px 0}
#native-player-name,
#native-village-name{font-size:13px;font-weight:bold;padding:4px 0}
#native-village-coordinates{font-size:11px;direction:ltr;text-align:center;margin:0}
#native-village-list button{display:block;border:0;background:none;color:inherit;text-align:start;width:100%;padding:4px}
#sidebarBeforeContent .innerBox.content a{display:block;margin:6px 0}
#sidebarBoxHero .playerName{overflow:hidden;max-width:155px;padding:8px 4px;font-size:11px}
.game-ready #village-panel{margin:0}
#classic-village:after{content:"";display:block;clear:both}
#native-building-page{position:relative;min-height:220px}
#native-building-page .build_desc{min-height:180px}
#native-building-page .building.big{float:inline-start;margin:0 12px 12px 0}
#native-construction-queue{clear:both;position:relative;margin-top:15px}
#native-construction-queue ol{padding-inline-start:22px;font-size:11px}
#native-construction-queue button{padding:2px 6px}
.building-list-image{width:24px!important;height:24px!important;background-size:contain;vertical-align:middle;margin-inline-end:6px}

/* Native game modules */
#native-production,
#native-troops{width:100%;border-collapse:collapse;margin:8px 0;font-size:11px}
#native-production th{padding:3px;border-bottom:1px solid rgba(82,62,40,.25);text-align:start}
#native-production td{padding:3px;border-bottom:1px solid rgba(82,62,40,.25);text-align:end}
#native-troops td{padding:3px;border-bottom:1px solid rgba(82,62,40,.25)}
#native-troops td:last-child{text-align:end}
.native-module form label{display:block;margin:10px 0 4px}
.native-module input,
.native-module select{max-width:100%;padding:4px}
.native-module button{margin:8px 0;padding:4px 10px}
.native-module button.build{padding:0}
.native-module section{background:none;border:0;box-shadow:none;padding:0}
.native-module p{line-height:1.8}
.native-module table{width:100%}

/* World map */
.map-scroll{overflow:auto;max-width:100%;height:540px;direction:ltr;background:transparent}
.native-module .world-map{border-collapse:collapse;width:max-content;table-layout:fixed;border:0;margin:0}
.world-map td{width:60px;min-width:60px;height:60px;border:0;padding:0;line-height:0;position:relative}
.native-module .world-map .map-tile{display:block;position:relative;width:60px;height:60px;margin:0;padding:0;border:0;background-color:transparent;border-radius:0}
.map-tile.selected{outline:2px solid #e7c36d;outline-offset:-2px;z-index:1}
.map-tile-actions button{margin-inline-end:8px}
#map-tile-details{margin:12px 0}
#native-map-details.nativeVillageStats{margin-top:8px}
#native-map-details .innerBox.content{padding:6px 8px}

/* Shared feedback */
#message:empty{display:none}
#message{color:#8b381f;padding:10px}

/* T4.6 login and registration shell */
body.login{min-width:0!important;overflow-x:hidden}
body.login #background{width:100%;max-width:1440px;min-width:0;margin-inline:auto}
body.login #topBar{display:grid;width:100%;max-width:1440px;min-width:0;height:84px;padding-inline:clamp(10px,1.25vw,16px);grid-template-columns:minmax(0,1fr)}
body.login #topBar #header{grid-column:1;width:min(100%,624px);height:84px;margin-inline:auto}
body.login #topBar #mtop{width:100%;height:84px}
body.login #topBar #logo{font-family:Arial,Helvetica,Verdana,sans-serif;font-size:24px;top:2px;inset-inline-start:0;width:80px;height:80px;margin:0}
body.login #bodyWrapper{width:100%;max-width:1440px;min-width:0;margin:16px auto 0;padding-inline:8px;box-sizing:border-box}
body.login #center{display:block;width:100%;max-width:1280px;min-width:0;min-height:0!important;height:auto!important;margin:0 auto;padding:0;box-sizing:border-box}
body.login #center #contentOuterContainer{top:auto;width:min(100%,624px);min-width:0;margin:0 auto}
body.login #center #contentOuterContainer .contentTitle{display:none}
body.login #center #contentOuterContainer .contentContainer{width:100%;margin:0 auto 10px;box-sizing:border-box}
body.login #center #contentOuterContainer .contentContainer #content{width:calc(100% - 34px);min-width:0;min-height:0;margin:0 auto;padding:16px 12px 20px;box-sizing:border-box}
body.login #login-panel,
body.login #register-panel{display:flex;justify-content:center;padding:0;margin:0}
body.login .outerLoginBox{width:564px;max-width:100%;min-height:235px;margin:0 auto}
body.login .outerLoginBox .loginTable{max-width:100%}
body.login .outerLoginBox input.text{max-width:100%}

/* Show the native 4.6 village landscape through the center canvas. */
body.game-ready.village2 #center #contentOuterContainer .contentContainer{background:transparent;border:0;padding:0}
body.game-ready.village2 #center #contentOuterContainer .contentContainer #content{background:transparent;width:1280px;min-width:1280px;min-height:720px;margin:0 auto;padding:0;box-sizing:border-box}
