/* The playable estate: painted ground, live DOM controls, and ambient SVG life. */
.screen--village { max-width: 1700px; }
.screen--village .screen-head { margin-bottom: 20px; }
.screen--village .screen-description { font-size: 14px; }
.village-header-actions { display: flex; align-items: center; gap: 10px; }
.village-header-actions .btn { font-size: 13px; min-height: 40px; }
.village-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 20px; align-items: start; }
.village-land { overflow: hidden; min-width: 0; border: 1px solid #a88a51; border-radius: 9px; background: #e8d8b6; box-shadow: 0 8px 28px #34251014; }
.village-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: linear-gradient(#f6edda, #ecddbc); border-bottom: 1px solid #af955f; font-size: 12px; color: #6a5635; }
.village-toolbar strong { color: #47341f; font: 600 19px var(--serif); }
.village-toolbar span { display: flex; gap: 8px; align-items: center; }
.village-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.village-stage { position: relative; width: 100%; min-width: 680px; aspect-ratio: 4 / 3; isolation: isolate; background: #667342; }
.village-background, .village-life, .village-plots, .village-buildings, .village-defences { position: absolute; inset: 0; width: 100%; height: 100%; }
.village-background { display: block; object-fit: fill; user-select: none; }
.village-defences { pointer-events: none; overflow: hidden; }
.village-defences--back { z-index: 1; }
.village-defences--front { z-index: 3; }
.village-life { pointer-events: none; overflow: hidden; z-index: 4; }
.village-buildings { pointer-events: none; z-index: 2; }
.village-building { position: absolute; }
.village-plots { pointer-events: none; z-index: 5; }
.village-building-sprite { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; filter: drop-shadow(2px 5px 2px #30261540); }
.village-plot { position: absolute; display: flex; justify-content: center; align-items: flex-end; padding: 0 0 2px; border: 1.5px solid transparent; border-radius: 22%; background: transparent; color: #2f230e; pointer-events: auto; transition: background .2s, border-color .2s, box-shadow .2s; }
.village-plot:hover { background: #fff3b712; border-color: #ffe7a08f; box-shadow: 0 0 22px #ffde7345, inset 0 0 14px #ffde7322; z-index: 2; }
.village-plot.is-selected { border-color: #f9d67c; box-shadow: 0 0 13px #f8d26c88, inset 0 0 12px #f8d26c22; background: #ffe9a00b; z-index: 1; }
.village-plot:focus-visible { outline: 3px solid #fff5c7; outline-offset: 4px; z-index: 3; }
.plot-label { display: flex; align-items: center; justify-content: center; gap: 7px; position: relative; flex-shrink: 0; white-space: nowrap; padding: 4px 9px; border: 1px solid #795c2c; border-radius: 3px; background: linear-gradient(#fff7df, #edddb6); box-shadow: 0 2px 0 #3f2d1980, inset 0 0 0 2px #d3b87e; font: 600 clamp(11px, .85vw, 15px)/1.3 var(--serif); transition: transform .18s, background .18s; }
.plot-label small { font: 600 .8em var(--sans); padding-left: 7px; border-left: 1px solid #bba370; color: #77613d; }
.village-plot:hover .plot-label { transform: translateY(-3px); background: #fff1c5; }
.village-plot.is-selected .plot-label { color: #fff7db; background: linear-gradient(#913b29, #6f251c); border-color: #e9c971; box-shadow: 0 2px 7px #30200e88, inset 0 0 0 1px #c49b4a; }
.village-plot.is-selected .plot-label small { color: #e8cb90; border-color: #b67d4b; }
.village-plot.is-building:not(.is-selected) .plot-label { background: #e5edce; }
.plot-cover { display: none; }
.village-plot.is-unbuilt .plot-cover { display: flex; align-items: center; justify-content: center; position: absolute; inset: 35% 15% 16%; border: 1px dashed #e3d2a2a0; border-radius: 50%; background: #b7a56d35; box-shadow: none; color: #f6e4b5; font: 400 26px var(--serif); text-shadow: 0 1px 3px #334125; }
.is-unbuilt .plot-cover > span { font-size: 26px; }
.village-map-caption { position: absolute; z-index: 5; left: 15px; bottom: 14px; font: italic 13px var(--serif); color: #fff3ce; padding: 6px 10px; border: 1px solid #b29c6270; border-radius: 4px; background: #2e301bbf; pointer-events: none; }
.village-footnote { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid #b39a68; background: #f4ead4; font-size: 12px; color: #786344; }
.village-footnote strong { color: #443920; font-weight: 600; }
.village-sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.village-detail { position: relative; padding: 22px; border: 1px solid #c5ad7d; border-radius: 9px; background: radial-gradient(ellipse at top, #fffaf0aa, transparent 70%), repeating-linear-gradient(105deg, #9d793b03 0 1px, transparent 1px 5px), #f4e8ce; box-shadow: 0 5px 18px #36220e0a, inset 0 0 0 4px #f9efdcbf; }
.village-detail .eyebrow { color: #907346; font-size: 10px; }
.village-detail h2 { margin: 0; font: 600 30px/1.1 var(--serif); letter-spacing: -.5px; }
.village-detail-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.village-detail-level { display: inline-block; color: #94663b; font-size: 12px; margin-top: 8px; }
.village-art-preview { position: relative; height: 150px; margin: 12px 0; overflow: hidden; border: 1px solid #d7c59e; border-radius: 6px; background: radial-gradient(ellipse at 50% 70%, #aab17a66, transparent 65%), #e9dfc3; }
.village-art-preview .village-building-sprite { inset: 0 25% 22px; width: 50%; height: calc(100% - 22px); }
.village-art-caption { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 9px; border-top: 1px solid #cdb98a; background: #f4ead4eb; font-size: 11px; color: #5d4b2f; }
.village-art-caption small { font-size: 10px; color: #82704e; }
.village-empty-marker { display: grid; place-items: center; height: calc(100% - 25px); color: #a79268; font: 40px var(--serif); }
.village-detail p { color: #776344; font: italic 15px/1.65 var(--serif); margin-bottom: 18px; }
.village-effect { border-top: 1px solid #d3be96; border-bottom: 1px solid #d3be96; padding: 14px 0; margin-bottom: 16px; }
.village-effect small { display: block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #927d58; margin-bottom: 5px; }
.village-effect strong { font: 500 16px/1.4 var(--serif); }
.village-build-time { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #88734f; font-size: 12px; margin: 0 0 12px; }
.village-detail .building-cost { font-size: 13px; gap: 10px; padding: 0 0 15px; }
.village-detail .building-cost svg { width: 18px; height: 18px; }
.village-detail .upgrade-btn { font-size: 13px; min-height: 44px; border-radius: 5px; }
.village-detail .btn--primary { background: linear-gradient(#963b2a, #7d281e); border-color: #a17c3a; box-shadow: inset 0 0 0 2px #e3bc6a33, 0 3px 8px #7e382222; }
.village-detail .btn--primary:hover { background: #a1442d; }
.village-picker { display: flex; flex-direction: column; gap: 7px; color: #7c6848; font-size: 12px; }
.village-picker select { min-height: 40px; width: 100%; padding: 7px 30px 7px 12px; border: 1px solid #c9b78e; border-radius: 6px; background: #faf2df; color: #4b3820; font-size: 14px; }
.village-sidebar .panel { border-color: #d3bf97; background: #f9f2e2; }
.village-sidebar .panel__head { font: 600 17px var(--serif); letter-spacing: 0; background: #f0e4ca; border-color: #d7c7a6; }
.village-sidebar .kv { font-size: 12px; }
.village-sidebar .panel__body { gap: 14px; }
.village-sidebar .progress-caption { font-size: 12px; }
.village-progress { margin-top: 18px; color: #53733f; }
.village-progress strong { font-size: 13px; }
.village-progress .bar { margin: 9px 0; height: 7px; }
.village-motion[aria-pressed="false"] { background: #e9dfc9; }
.village-pause-icon { font-size: 14px; }
/* Pure transform/opacity animation. No JavaScript animation loop or layout work. */
.villager-route { offset-rotate: 0deg; animation: village-stroll var(--duration, 32s) linear var(--delay, 0s) infinite; }
.villager-body { animation: village-bob .65s ease-in-out var(--delay, 0s) infinite alternate; }
.villager-leg { transform-origin: 0 -5px; animation: village-step .65s ease-in-out infinite alternate; }
.villager-leg--right { animation-direction: alternate-reverse; }
.villager-arm { transform-origin: 0 -10px; animation: village-step .65s ease-in-out infinite alternate-reverse; }
.smoke-puff { opacity: 0; animation: village-smoke 7.2s ease-out var(--delay, 0s) infinite; }
.village-hammer { transform-origin: 2px -9px; animation: village-work 1.8s ease-in-out infinite; }
.forge-glow { opacity: .3; animation: village-embers 2.7s ease-in-out infinite alternate; }
@keyframes village-stroll { to { offset-distance: 100%; } }
@keyframes village-bob { to { transform: translateY(-.65px); } }
@keyframes village-step { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes village-smoke { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 15% { opacity: .4; } 65% { opacity: .2; } 100% { opacity: 0; transform: translate(14px, -44px) scale(2.6); } }
@keyframes village-work { 0%, 40%, 100% { transform: rotate(0); } 65% { transform: rotate(-65deg); } 75% { transform: rotate(15deg); } }
@keyframes village-embers { to { opacity: .65; transform: translateY(-1px); } }
.village-stage.is-paused *, .village-stage.is-paused *::before { animation-play-state: paused !important; }
@media (min-width: 1550px) { .village-layout { grid-template-columns: minmax(0, 1fr) 310px; } }
@media (max-width: 1220px) { .village-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; } .village-detail { padding: 18px; } .village-detail h2 { font-size: 27px; } .village-building-art { height: 120px; } }
@media (max-width: 1080px) { .village-layout { grid-template-columns: minmax(0, 1fr); } .village-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .village-picker { grid-column: 1 / -1; } #village-detail { grid-row: span 3; } .village-header-actions .village-world-link { display: none; } .plot-label { font-size: 13px; } }
@media (max-width: 720px) { .screen--village .screen-head__extra { display: block; } }
@media (max-width: 600px) { .village-sidebar { display: flex; } .village-toolbar, .village-footnote { padding: 11px 12px; font-size: 11px; } .village-toolbar > span { max-width: 48%; text-align: right; } .village-footnote { flex-wrap: wrap; } .screen--village .screen-head { align-items: flex-start; gap: 10px; } .screen--village .screen-description { font-size: 12px; max-width: 210px; } .village-header-actions .btn { font-size: 11px; padding: 8px; } .village-detail { padding: 22px; } .village-building-art { height: 170px; } .plot-label { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { .village-life * { animation-play-state: paused !important; } }
@media (max-width: 600px) { .screen--village .village-sidebar { align-items: stretch; } }
