.town-page { background:radial-gradient(ellipse at top,#375851,#182e30 45%,#141822); }
.town-page .puzzle-main { width:min(calc(100% - 20px),690px); }
.town-game { overflow:hidden; color:#fff4dc; border:1px solid #829385; border-radius:16px; background:#203531; box-shadow:0 20px 45px #0c1516a0; }
.town-hud { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; padding:9px; }
.town-hud div { padding:6px 9px; border-radius:8px; background:#152925; font-size:.8rem; color:#dbe6ca; }
.town-hud strong { display:block; color:#ffe6aa; font-size:1.13rem; font-variant-numeric:tabular-nums; }
.town-map {
  padding:clamp(45px,9vw,83px) clamp(7px,2vw,16px) 10px;
  background:url("platform-assets/tiny-town.webp") center 25%/cover,#638566;
  border-block:1px solid #a1ae82;
}
.town-shore {
  display:table; margin:0 auto 4px; padding:3px 10px; border-radius:999px;
  background:#153e47; color:#f6f6db; font-size:.75rem;
}
.town-grid {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px;
  padding:5px; border-radius:10px; background:#263c2a80;
}
.town-plot {
  position:relative; display:grid; place-items:center; grid-template-rows:1fr auto; min-width:0;
  height:clamp(80px,23vw,130px); padding:4px; overflow:hidden; touch-action:manipulation;
  background:#213a31bb; border:1px solid #a2ad82;
  border-radius:8px; color:#fff5cb; cursor:pointer; font:inherit; font-size:clamp(.7rem,2.8vw,.94rem); font-weight:700;
}
.town-plot[aria-pressed="true"] { border:2px solid #ffe097; background-color:#2a483d; }
.town-plot[data-ready="true"] { box-shadow:inset 0 0 0 2px #e8efa0; }
.town-plot[data-ready="true"]::after { content:'Ready'; position:absolute; top:4px; right:4px; padding:2px 5px; border-radius:6px; background:#e8efa0; color:#1d301d; font-size:.65rem; }
.town-plot[data-locked="true"] .town-sprite { opacity:.45; filter:saturate(.4); }
.town-plot:enabled:hover,.town-plot:focus-visible { outline:2px solid #fff1b6; outline-offset:-3px; }
.town-sprite {
  display:block; width:min(100%,105px); height:100%; max-height:98px;
  background:url("platform-assets/tiny-town-buildings.webp") var(--sprite-x,0%) var(--sprite-y,0%)/400% 200% no-repeat;
  filter:drop-shadow(1px 3px 2px #17261365);
}
.town-sprite:is([data-building="1"],[data-building="5"]) { --sprite-x:33.3333%; }
.town-sprite:is([data-building="2"],[data-building="6"]) { --sprite-x:66.6667%; }
.town-sprite:is([data-building="3"],[data-building="7"]) { --sprite-x:100%; }
.town-sprite:is([data-building="4"],[data-building="5"],[data-building="6"],[data-building="7"]) { --sprite-y:100%; }
.town-panel { padding:10px 12px; }
.town-panel h2 { margin:0 0 6px; font-size:1rem; }
.town-offers { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.town-offers button {
  display:grid; justify-items:center; align-content:center; gap:3px; min-height:73px; padding:4px;
  border:1px solid #6c816d; border-radius:8px; background:#182e29; color:#fff3d0;
  font:inherit; font-size:.8rem; font-weight:700; cursor:pointer;
}
.town-offers button[aria-pressed="true"] { border-color:#ffe2a1; background:#3d523a; }
.town-offers .town-sprite { width:48px; height:46px; }
.town-panel p { margin:6px 0; font-size:.82rem; color:#e5e6c7; }
#town-status { color:#ffe3a0; }
.town-panel details { margin:8px 0; font-size:.85rem; }
.town-panel summary { cursor:pointer; }
.town-panel ul { margin:6px 0; }
.town-actions { display:flex; flex-wrap:wrap; gap:6px; }
.town-actions button { min-height:44px; }
.town-stock { display:flex; flex-wrap:wrap; gap:5px; padding:0; margin:0 0 12px; list-style:none; }
.town-stock li { padding:3px 7px; border-radius:6px; background:#142923; color:#e6edca; font-size:.78rem; }
.town-trade { margin-bottom:12px; }
.town-orders { display:grid; gap:6px; grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr)); }
.town-orders > div { background:#172e27; border:1px solid #668272; border-radius:8px; padding:8px; }
.town-orders button { min-height:44px; }
