.world-map-panel{border:1px solid var(--classic-border,var(--border));background:var(--card);margin:0 0 18px}.map-titlebar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 9px;background:linear-gradient(180deg,#dfc58b,#b88b45);color:#362111}.map-titlebar h2{font:700 15px Georgia,serif;margin:0}.map-view-tabs{display:flex;gap:8px;font-size:12px}.map-view-tabs a{padding:3px 7px;border:1px solid #91662e}.map-view-tabs a[aria-current]{background:#f6e2b2}.map-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 10px;border-bottom:1px solid var(--border);margin:0}.map-controls label{display:flex;align-items:center;gap:5px;margin:0;font-size:12px}.map-controls input{width:76px;min-height:32px;padding:4px 7px;margin:0;font-size:13px}.map-controls .button{min-height:32px;padding:5px 10px;font-size:11px}.map-compass{display:flex;justify-content:center;align-items:center;gap:10px;padding:7px;background:var(--alt);border-bottom:1px solid var(--border)}.map-compass a{min-width:32px;min-height:30px;display:grid;place-items:center;border:1px solid var(--border);color:var(--accent);font-size:19px}.map-compass span{font-weight:700;min-width:75px;text-align:center}.world-map-viewport{overflow:auto;max-height:550px;background:#719354;overscroll-behavior:contain;scrollbar-color:#927844 #b9c295}.world-map-grid{display:grid;grid-template-columns:repeat(22,36px);grid-auto-rows:36px;width:792px;position:relative}.map-axis{display:grid;place-items:center;font-size:10px;line-height:1;color:#422d17;background:#dcc48d;border:1px solid #96764255;font-weight:700}.map-axis-x{position:sticky;top:0;z-index:3}.map-axis-y{position:sticky;left:0;z-index:3}.map-corner{position:sticky;top:0;left:0;z-index:4;font-size:9px}.map-tile{display:grid;place-items:center;position:relative;background-color:#82a064;border:1px solid #526e3533;min-width:0;min-height:0}.map-grass{background-image:radial-gradient(ellipse at 28% 36%,#a5bb7e55 0,transparent 65%)}.map-forest{background-image:url('map/forest.svg');background-size:100% 100%}.map-settlement{background:#a7ac70;cursor:pointer}.map-settlement img{width:32px;height:32px;object-fit:contain}.map-own{background:#689ba1;box-shadow:inset 0 0 0 2px #28547c}.map-protected{background:#c9b57c;box-shadow:inset 0 0 0 2px #967332}.map-other{background:#b8876b;box-shadow:inset 0 0 0 2px #925134}.map-settlement:hover,.map-settlement:focus-visible,.map-selected{outline:3px solid #f8e89c;outline-offset:-3px;z-index:2;filter:brightness(1.15)}.map-shield{position:absolute;right:0;top:0;font-size:9px;color:#fff3b4;background:#816632;border-radius:3px;padding:0 2px;line-height:1.2}.map-legend{display:flex;flex-wrap:wrap;gap:14px;padding:10px;font-size:11px;border-top:1px solid var(--border)}.map-legend>span{display:flex;align-items:center;gap:6px}.map-legend i{width:13px;height:13px;border:1px solid #634627}.legend-own{background:#689ba1}.legend-protected{background:#c9b57c}.legend-other{background:#b8876b}.map-help{padding:0 10px 10px;font-size:11px;color:var(--muted);margin:0}.map-target{scroll-margin-top:15px}.world-map-panel .table-wrap{padding:0 10px}.world-map-panel th,.world-map-panel td{font-size:12px}
@media(max-width:760px){.world-map-viewport{max-height:430px}.map-titlebar h2{font-size:13px}.map-controls{padding:7px}.map-controls input{width:65px;font-size:16px}.map-compass a{min-height:36px;min-width:36px}.map-controls .button{min-height:36px}.map-legend{gap:9px}.map-titlebar{flex-wrap:wrap}}

/* Mouse dragging and native touch panning, without visible scrollbars. */
.world-map-viewport{scrollbar-width:none;-ms-overflow-style:none;cursor:grab;user-select:none;touch-action:pan-x pan-y}.world-map-viewport::-webkit-scrollbar{display:none;width:0;height:0}.world-map-viewport.is-dragging,.world-map-viewport.is-dragging *{cursor:grabbing!important}.world-map-grid{grid-template-columns:repeat(22,48px);grid-auto-rows:48px;width:1056px}.map-settlement img{width:41px;height:41px;pointer-events:none}.map-tile{touch-action:pan-x pan-y}.map-axis{font-size:11px}.map-corner{font-size:10px}

/* Compact village art and the on-map action palette. */
.map-settlement{background:#82a064}.map-settlement img{width:35px;height:35px}.map-own{box-shadow:inset 0 0 0 2px #e2c151}.map-protected{box-shadow:inset 0 0 0 1px #bba262}.map-other{box-shadow:inset 0 0 0 1px #845244}.map-own::after,.map-other::after,.map-protected::after{content:"";position:absolute;left:3px;bottom:3px;width:6px;height:6px;border-radius:50%;border:1px solid #452f1c;background:#b65a2d}.map-own::after{background:#ffe37a}.map-protected::after{background:#dccb8d}.map-village-tooltip,.map-context{position:fixed;z-index:45;background:#f1dfb0;color:#31220f;border:1px solid #9f793d;box-shadow:0 5px 15px #0003;border-radius:2px;width:280px;max-width:calc(100vw - 16px);font-size:12px;text-shadow:none}.map-village-tooltip[hidden],.map-context[hidden]{display:none}.map-village-tooltip{pointer-events:none}.map-village-tooltip>strong,.map-context header{display:block;padding:4px 7px;background:linear-gradient(180deg,#dfc58b,#b88b45);font-size:12px;overflow-wrap:anywhere}.map-village-tooltip dl{display:grid;grid-template-columns:75px 1fr;margin:0;padding:4px 7px;gap:4px}.map-village-tooltip dt,.map-village-tooltip dd{margin:0;overflow-wrap:anywhere}.map-context header{display:flex;align-items:center;justify-content:space-between;gap:10px}.map-context-close{background:transparent;border:0;color:#8e321b;font-size:22px;line-height:1;cursor:pointer}.map-context>p{margin:5px 7px;font-size:11px}.map-context-actions{display:flex;justify-content:center;gap:5px;padding:8px}.map-context-actions>a,.map-context-actions>button{display:grid;place-items:center;width:42px;height:42px;background:linear-gradient(180deg,#9b794a,#5c3b22);color:#f9e2b1;border:2px ridge #9f793d;border-radius:5px;cursor:pointer}.map-context-actions svg{width:23px;height:23px}.map-context-actions>button:disabled{opacity:.4;cursor:not-allowed}.map-context-actions>a:hover,.map-context-actions>button:not(:disabled):hover{background:#ab854c}.map-player-info{padding:8px;border-top:1px solid #a78247}.map-player-info[hidden]{display:none}.map-player-info h3{font-size:13px;margin:0 0 8px}.map-player-info p{margin:6px 0}.map-player-info .text-link{color:#815126;font-size:12px}.rank-own:target,tr[id^="rank-player-"]:target{outline:2px solid var(--accent);outline-offset:-2px}
#map-context{left:8px;top:100px}
#map-village-tooltip{left:8px;top:100px}

.map-settlement.context-selected{outline:3px solid #f3d36b;outline-offset:-4px;z-index:2}.map-settlement.context-selected img{filter:brightness(1.1)}

/* Continuous 0..999 world, with only the visible tiles mounted. */
.world-map-viewport.continuous-map{height:550px;max-height:550px}.continuous-map .world-map-grid{display:block;width:48000px;height:48000px;contain:layout paint}.continuous-map .map-tile{position:absolute;width:48px;height:48px}.map-axis{background:transparent!important;border:0!important;color:#f7edce!important;text-shadow:0 1px 2px #142913,1px 0 2px #142913,-1px 0 2px #142913;font-size:11px;pointer-events:none}.continuous-map .map-axis{position:absolute;display:grid;place-items:center;font-weight:700}.continuous-map .map-axis-x{width:48px;height:22px;z-index:4}.continuous-map .map-axis-y{width:28px;height:48px;z-index:4}.map-corner{display:none!important}
.continuous-map .map-axis-x{top:0}
.continuous-map .map-axis-y{left:0}
@media(max-width:760px){.world-map-viewport.continuous-map{height:430px;max-height:430px}}

/* Original supplied map textures and settlements. */
.world-map-viewport,.map-tile{background-color:#66812b}.map-tile{border-color:#40531a44}.map-settlement{background-image:url('source-0470/map/gras1.png');background-size:100% 100%;box-shadow:none}.map-settlement img{width:100%;height:100%;object-fit:fill}.map-own{box-shadow:inset 0 0 0 1px #f6d86a}.map-protected{box-shadow:inset 0 0 0 1px #afaa69}.map-other{box-shadow:none}.map-settlement::after{z-index:3}.map-settlement:hover,.map-settlement:focus-visible{filter:brightness(1.05)}
.map-terrain-grass-1{background-image:url('source-0470/map/gras1.png');background-size:100% 100%}
.map-terrain-grass-2{background-image:url('source-0470/map/gras2.png');background-size:100% 100%}
.map-terrain-grass-3{background-image:url('source-0470/map/gras3.png');background-size:100% 100%}
.map-terrain-grass-4{background-image:url('source-0470/map/gras4.png');background-size:100% 100%}
.map-terrain-grass-5{background-image:url('source-0470/map/gras5.png');background-size:100% 100%}
.map-terrain-forest-1{background-image:url('source-0470/map/forest1010.png'),url('source-0470/map/gras1.png');background-size:100% 100%}
.map-terrain-forest-2{background-image:url('source-0470/map/forest0110.png'),url('source-0470/map/gras1.png');background-size:100% 100%}
.map-terrain-forest-3{background-image:url('source-0470/map/forest1111.png'),url('source-0470/map/gras1.png');background-size:100% 100%}
.map-terrain-lake-1{background-image:url('source-0470/map/lago1.png'),url('source-0470/map/gras1.png');background-size:100% 100%}
.map-terrain-lake-2{background-image:url('source-0470/map/lago2.png'),url('source-0470/map/gras1.png');background-size:100% 100%}
.map-terrain-lake-3{background-image:url('source-0470/map/lago3.png'),url('source-0470/map/gras1.png');background-size:100% 100%}




/* Keep the source map tiles at their original 53x38 proportion. */
.world-map-grid{grid-template-columns:repeat(22,53px);grid-auto-rows:38px;width:1166px}.continuous-map .world-map-grid{width:53000px;height:38000px}.continuous-map .map-tile{width:53px;height:38px}.continuous-map .map-axis-x{width:53px;height:18px}.continuous-map .map-axis-y{height:38px}

/* Six supplied village stages. Original atlas is preserved byte for byte. */
.map-castle{display:block;width:53px;height:38px;background-image:url('castle-atlas-0472.png');background-size:159px 76px;background-repeat:no-repeat;pointer-events:none}
.castle-stage-1{background-position:0 0}.castle-stage-2{background-position:-53px 0}.castle-stage-3{background-position:-106px 0}.castle-stage-4{background-position:0 -38px}.castle-stage-5{background-position:-53px -38px}.castle-stage-6{background-position:-106px -38px}
.map-context{width:180px;min-height:240px;background:transparent;border:0;box-shadow:none;pointer-events:none;overflow:visible}
.map-context header{position:absolute;top:180px;left:-20px;width:220px;justify-content:center;background:#f1dfb0;border:1px solid #9f793d;pointer-events:auto}
.map-context>p{position:absolute;top:208px;left:-20px;width:220px;margin:0;padding:4px;background:#f1dfb0;text-align:center;pointer-events:auto}
.map-context-center{position:absolute;left:63.5px;top:71px}
.map-context-actions{position:absolute;inset:0;display:block;padding:0;pointer-events:none}
.map-context-actions>a,.map-context-actions>button{position:absolute;width:44px;height:44px;border-radius:50%;pointer-events:auto;box-shadow:0 2px 5px #0007}
.map-context-actions>:nth-child(1){left:68px;top:0}.map-context-actions>:nth-child(2){left:5px;top:45px}.map-context-actions>:nth-child(3){right:5px;top:45px}.map-context-actions>:nth-child(4){right:23px;top:120px}.map-context-actions>:nth-child(5){left:23px;top:120px}
.map-context .map-context-close{position:absolute;right:0;top:0;width:24px;height:24px;pointer-events:auto}
.map-context .map-player-info{margin-top:245px;width:220px;margin-left:-20px;background:#f1dfb0;border:1px solid #9f793d;pointer-events:auto}
.map-context .map-context-actions>button:disabled{opacity:.65}
.map-settlement.context-selected{outline:none}

/* One ground surface across the world; terrain tiles never carry a square base. */
.world-map-grid{background-color:#668139;background-image:linear-gradient(#657f36bb,#657f36bb),url('source-0470/map/gras1.png');background-size:auto,53px 38px}
.world-map-grid .map-tile{border:0;background:none;box-shadow:none;overflow:visible}
.world-map-grid .map-continent-west{border-left:1px solid #344622b3}
.world-map-grid .map-continent-north{border-top:1px solid #344622b3}
.map-terrain-art{position:absolute;inset:0;pointer-events:none;background-repeat:repeat;background-size:53px 38px;--edge-n:linear-gradient(#000,#000);--edge-e:linear-gradient(#000,#000);--edge-s:linear-gradient(#000,#000);--edge-w:linear-gradient(#000,#000);mask-image:var(--edge-n),var(--edge-e),var(--edge-s),var(--edge-w);mask-composite:intersect;-webkit-mask-image:var(--edge-n),var(--edge-e),var(--edge-s),var(--edge-w);-webkit-mask-composite:source-in}
.terrain-forest{background-image:url('source-0470/map/forest1111.png')}



.terrain-lake{background-color:#426f70;background-image:linear-gradient(170deg,#d3d5a50b 10%,#234e6522 48%,#73939822 54%,#2d5f6622 90%);background-size:53px 38px}
.terrain-edge-n{--edge-n:linear-gradient(to bottom,transparent,#000 9px)}
.terrain-edge-e{--edge-e:linear-gradient(to left,transparent,#000 9px)}
.terrain-edge-s{--edge-s:linear-gradient(to top,transparent,#000 9px)}
.terrain-edge-w{--edge-w:linear-gradient(to right,transparent,#000 9px)}
.terrain-edge-n.terrain-edge-w{border-top-left-radius:24px 18px}
.terrain-edge-n.terrain-edge-e{border-top-right-radius:24px 18px}
.terrain-edge-s.terrain-edge-w{border-bottom-left-radius:24px 18px}
.terrain-edge-s.terrain-edge-e{border-bottom-right-radius:24px 18px}
/* A modestly larger settlement and a ground shadow lift villages above terrain. */
.map-castle{background-size:300% 200%}
.castle-stage-1{background-position:0 0}.castle-stage-2{background-position:50% 0}.castle-stage-3{background-position:100% 0}.castle-stage-4{background-position:0 100%}.castle-stage-5{background-position:50% 100%}.castle-stage-6{background-position:100% 100%}
.world-map-grid .map-settlement{z-index:2}
.map-settlement .map-castle{position:absolute;left:50%;top:50%;width:63.6px;height:45.6px;transform:translate(-50%,-50%);filter:brightness(1.13) contrast(1.08);mask-image:linear-gradient(to right,transparent,#000 5px,#000 calc(100% - 5px),transparent),linear-gradient(to bottom,transparent,#000 4px,#000 calc(100% - 4px),transparent);mask-composite:intersect;-webkit-mask-image:linear-gradient(to right,transparent,#000 5px,#000 calc(100% - 5px),transparent),linear-gradient(to bottom,transparent,#000 4px,#000 calc(100% - 4px),transparent);-webkit-mask-composite:source-in}
.map-settlement::before{content:"";position:absolute;inset:3px -2px -1px;border-radius:50%;box-shadow:0 2px 4px #1f2c20aa;background:#b6aa7140}
.map-settlement::after{width:7px;height:7px;bottom:0;left:0;box-shadow:0 1px 2px #0007}
.world-map-grid .map-settlement:hover,.world-map-grid .map-settlement.context-selected,.world-map-grid .map-selected{outline:none;filter:brightness(1.08);z-index:3}
.world-map-grid .map-settlement:focus-visible{outline:2px solid #f6e6c0;outline-offset:1px}
.map-legend .legend-own{background:#ffe37a}.map-legend .legend-protected{background:#dccb8d}.map-legend .legend-other{background:#b65a2d}

.map-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:12px;padding:10px}
.map-main{min-width:0;border:1px solid #987940}.map-mini-panel{min-width:0;align-self:start;padding:8px;background:var(--card);border:1px solid var(--border)}
.map-mini-panel h3{margin:0 0 8px;font:700 14px Georgia,serif}.map-mini-panel p{font-size:11px;line-height:1.5;margin:8px 0}.map-mini-panel .check{font-size:12px;margin:0}
#world-minimap{display:block;width:100%;height:auto;aspect-ratio:1;cursor:crosshair;touch-action:none;border:1px solid #6c6135;background:#748847}
.map-main .world-map-viewport.continuous-map{height:440px;max-height:440px}.map-main .map-legend{padding:8px;gap:10px}
.map-barbarian::after{content:"";position:absolute;left:0;bottom:0;width:7px;height:7px;border-radius:50%;border:1px solid #3d3d30;background:#bcb6a3;z-index:3;box-shadow:0 1px 2px #0007}
.map-legend .legend-barbarian{background:#bcb6a3}
/* Several original tree silhouettes break uniform rows while keeping the shared ground. */
.terrain-forest.terrain-variant-1{background-image:url('source-0480/forest1010.png')}
.terrain-forest.terrain-variant-2{background-image:url('source-0480/forest0110.png')}
.terrain-forest.terrain-variant-3{background-image:url('source-0480/forest1111.png')}
@media(max-width:760px){.map-layout{grid-template-columns:1fr;padding:6px;gap:8px}.map-mini-panel{width:100%;max-width:300px;justify-self:center}.map-main .world-map-viewport.continuous-map{height:380px;max-height:380px}}

/* Search and display options share the compact map sidebar. */
.map-search-form{margin:12px 0 0;border-top:1px solid var(--border);padding-top:10px}
.map-search-form h3{margin:10px 0 6px;padding:4px 6px;background:var(--alt);border:1px solid var(--border);color:var(--text)}
.map-search-types{display:flex;gap:10px;flex-wrap:wrap;margin:0;padding:0;border:0}
.map-search-types legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.map-search-types label{display:flex;align-items:center;gap:4px;font-size:11px;margin:4px 0;color:var(--text)}
.map-search-types input[type=radio]{display:inline-block;width:14px;height:14px;min-height:0;margin:0;accent-color:var(--accent)}
.map-search-query{font-size:11px;margin:6px 0}.map-search-query input{font-size:13px;border-radius:3px;min-height:36px;padding:6px 8px}
.map-search-buttons{display:flex;align-items:center;gap:14px}.map-search-buttons .button{min-height:32px;border-radius:3px;font-size:11px;padding:5px 12px}.map-search-buttons a{font-size:11px;text-decoration:underline}
.map-search-results{list-style:none;padding:0;margin:0;max-height:230px;overflow-y:auto;overscroll-behavior:contain;border-top:1px solid var(--border)}
.map-search-results:empty{display:none}.map-search-results li{margin:0;border-bottom:1px solid var(--border)}
.map-search-results a{display:block;padding:8px 5px;min-height:44px;overflow-wrap:anywhere;color:var(--text)}
.map-search-results a:hover,.map-search-results a:focus-visible{background:var(--alt)}.map-search-results a:focus-visible{outline-offset:-2px}
.map-search-results strong,.map-search-results span{display:block;font-size:11px}.map-search-results span{font-size:10px;color:var(--muted);margin-top:2px}
.map-mini-panel .map-filter-check{align-items:flex-start;line-height:1.5;padding-top:3px}.map-filter-check input{flex-shrink:0}
#map-filter-notice{padding:7px;border:1px solid var(--border);background:var(--alt);color:var(--text)}
#map-filter-notice[hidden]{display:none}.map-mini-panel .map-filter-help{font-size:10px;color:var(--muted)}
@media(max-width:760px){.map-search-query input{font-size:16px;min-height:44px}.map-search-types label{min-height:36px}.map-search-buttons .button,.map-search-buttons a{min-height:40px;display:inline-flex;align-items:center}.map-mini-panel .map-filter-check{min-height:44px;align-items:center}}
