.sr-only { position: absolute; height: 1px; width: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.village-sprite, .craft-sprite { display: inline-block; flex: 0 0 auto; width: var(--art-size); height: var(--art-size); background-repeat: no-repeat; image-rendering: pixelated; }
.village-sprite { background-image: url('./art/village-kit.webp'); background-size: 300% 300%; }
.craft-sprite { background-image: url('./art/craft-kit.webp'); background-size: 600% 300%; }
.cartridge { font-family: Barlow, system-ui, sans-serif; color: #2b2830; }
.cartridge h2 { margin: 4px 0 7px; font: 400 clamp(21px,2vw,29px)/1.15 var(--display); letter-spacing: -1px; }
.cartridge p { line-height: 1.45; }
.cart-mast { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px clamp(14px,2.2vw,28px); background: #344c49; color: #fff1c9; border-bottom: 3px solid var(--ink); }
.cart-mast > div { display: flex; align-items: center; gap: 7px; font: 700 11px var(--mono); letter-spacing: 1px; }
.cart-mast > strong { font-size: 15px; }
.cart-eyebrow { display: flex; align-items: center; gap: 6px; font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: 1px; color: #665445; }
.cart-button { border: 2px solid var(--ink); border-radius: 4px; background: #fff8e4; box-shadow: 2px 2px 0 var(--ink); padding: 8px 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cart-button.bright { background: #ffcf61; }
.cart-button.small { padding: 4px 7px; font-size: 13px; }
.cart-button:enabled:hover { background: #ffe9a8; }
.cart-button:disabled { color: #776d5b; border-color: #a59a80; box-shadow: none; background: #e7ddc3; }
.cart-feedback { border-left: 3px solid #96a77a; background: #ebeedc; padding: 8px 11px; font-size: 14px; line-height: 1.38; }
.village-game { --shore: #839d66; background: #f7efd9; }
.village-game.season-summer { --shore: #9b9a58; }
.village-game.season-dry { --shore: #ae9365; }
.village-game.season-winter { --shore: #aecac8; background: #eef0e4; }
.season-summer .cart-mast { background: #5c603b; }
.season-dry .cart-mast { background: #7d573c; }
.season-winter .cart-mast { background: #405d6b; }
.village-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(285px,.85fr); gap: clamp(18px,2.3vw,36px); max-width: 1320px; margin: 0 auto; padding: clamp(14px,2.1vw,28px); align-items: center; }
.village-meters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-bottom: 10px; }
.village-meter { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px; padding: 4px 3px 6px; background: #fff8e5; border: 1.5px solid #ac9978; border-radius: 5px; font-size: 13px; }
.village-meter > span:not(.piece) { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.village-meter i { height: 4px; width: 81%; background: linear-gradient(to right,#61885d 0 var(--fill),#ddd3b7 var(--fill) 100%); }
.village-meter.reached { border-color: #507b57; background: #e6f0d4; }
.map-frame { border: 3px solid #4a453a; padding: 5px; background: #ad8957; border-radius: 5px; box-shadow: 3px 3px 0 #3d3740; }
.field-scroll { width: 100%; overflow: auto; scrollbar-color: #7d7159 #c7b993; }
.village-board { display: grid; grid-template-columns: repeat(var(--columns),minmax(0,1fr)); border: 1px solid #5e7250; background: #a4bd7b; }
.village-board.map-zoomed { min-width: max(135%, calc(var(--columns)*60px)); }
.village-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1.23; min-height: 35px; overflow: hidden; padding: 0; border: 0; border-right: 1px solid #57724950; border-bottom: 1px solid #57724950; background: #92b867; }
.village-cell.river { border-color: #477b92a3; }
.village-cell:focus-visible { z-index: 1; outline-offset: -3px; }
.village-cell .ghost, .village-cell .on-land { position: absolute; inset: 0; display: grid; place-items: center; }
.field-ground { position: absolute; inset: 0; background: url('./art/season-ground.png') no-repeat; background-size: 800% 400%; image-rendering: pixelated; }
.village-cell .on-land .village-sprite,.village-cell .ghost .village-sprite { height: 95%; width: auto; aspect-ratio: 1; max-width: 100%; }
.village-cell.lift-source { outline: 3px solid #f9e178; outline-offset: -3px; }
.yield-preview { position: absolute; bottom: 1px; padding: 1px 4px; border-radius: 2px; background: #242b23eb; color: #fff1cb; font-size: 11px; font-weight: 700; opacity: 0; pointer-events: none; }
.village-cell:is(:hover,:focus-visible) .yield-preview { opacity: 1; }
.village-cell .ghost { opacity: 0; background: #fff4ae55; }
.village-cell.available:is(:hover,:focus-visible) .ghost { opacity: .64; }
.village-cell.newly-built .on-land { animation: plant .22s ease-out; }
@keyframes plant { from { transform: translateY(-9px); opacity: .3; } }
.village-tools { display: flex; flex-direction: column; align-items: stretch; }
.village-tools > p { margin: 0 0 10px; font-size: 15px; }
.build-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.build-choices button { display: flex; align-items: center; gap: 8px; padding: 3px 8px; background: #fff9e9; border: 1.5px solid #b5a88b; border-radius: 4px; text-align: left; }
.build-choices button[aria-pressed="true"] { border-color: #344c49; background: #e2edcc; box-shadow: inset 3px 0 #527c56; }
.build-choices button small { display: block; font-size: 12px; color: #5d534d; }
.build-choices button .icon { margin-left: auto; }
.build-choices button { min-height: 49px; }
.build-choices button span { min-width: 0; }
.build-edit { margin-top: 8px; display: flex; gap: 8px; }
.build-edit [aria-pressed=true] { background: #dee9c3; }
.village-map-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 0 0; font-size: 13px; }
.village-map-foot button,.season-extra button { display: inline-flex; align-items: center; gap: 4px; justify-content: center; padding: 5px 7px; border: 1px solid #9c9276; border-radius: 4px; color: #413c37; background: #fff9e5; font-size: 12px; font-weight: 700; }
.village-map-foot button { margin-left: auto; }
.required-work { display: inline-flex; align-items: center; gap: 4px; color: #786341; }
.required-work.built { color: #365e3d; }
.village-opening { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; padding: 9px 11px; border: 2px solid #536f4d; border-radius: 6px; background: #e0edc6; box-shadow: 2px 2px #91a17e; }
.village-opening h3 { font: 400 18px/1.15 var(--display); margin: 0; letter-spacing: -.5px; }
.village-opening p { font-size: 13px; margin: 3px 0 0; }
.village-opening button { margin-left: auto; }
.season-extra { display: grid; gap: 3px; border: 1px dashed #b9a679; padding: 7px 9px; font-size: 13px; background: #fff6da; border-radius: 5px; margin: 2px 0 9px; }
.season-extra > span { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.season-extra span > .icon { color: #866522; }
.season-extra button[aria-pressed=true] { background: #dce7c5; }
.village-tools .build-tip { min-height: 32px; display: flex; gap: 6px; align-items: center; margin: 5px 0; color: #594e40; font-size: 13px; }
.village-tools .cart-feedback { min-height: 38px; margin-bottom: 10px; }
@media (max-width:740px){
  .village-layout { display: flex; flex-direction: column; align-items: stretch; padding: 12px; gap: 8px; }
  .village-tools { display: contents; }
  .village-tools .cart-eyebrow,.village-tools h2 { display: none; }
  .village-tools > p:first-of-type { margin: 0; order: 0; }
  .village-tools .build-choices { order: 1; }
  .village-world { order: 2; }
  .village-tools .build-edit { order: 3; margin-top: 0; }
  .village-tools .build-tip { order: 4; min-height: 0; margin: 0; }
  .village-tools .season-extra { order: 5; margin-block: 0; }
  .village-tools .cart-feedback { order: 6; margin-bottom: 0; }
  #village-primary { order: 7; }
  .village-tools .build-choices { grid-template-columns: repeat(auto-fit,minmax(100px,1fr)); }
  .village-meter { gap: 0; }
  .village-meter .piece { width: 23px; height: 23px; }
}
@media (max-width:570px){
  .village-layout { grid-template-columns: 1fr; }
  .village-tools .cart-eyebrow { display: none; }
  .village-tools > p { font-size: 14px; }
  .village-tools .build-choices { grid-template-columns: repeat(auto-fit,minmax(85px,1fr)); }
  .build-choices button { justify-content: flex-start; gap: 3px; padding: 3px; }
  .build-choices button .village-sprite { width: 30px; height: 30px; }
  .build-choices button .icon { display: none; }
  .build-choices button b { font-size: 13px; }
  .build-choices button small { font-size: 11px; }
  .village-cell { aspect-ratio: 1.35; }
  .village-meter { padding-block: 2px 4px; }
  .cart-mast { padding: 8px 12px; }
  .cart-mast > div { font-size: 10px; }
}
