/* A handmade toy village: all illustrations are local SVG. */
.rabbit-town {
  --town-green: #486d58;
  min-width: 0;
}
.town-heading {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  margin: 12px 0 24px;
}
.town-kicker {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 800;
  color: #637e65;
}
.town-heading h2 {
  font:
    500 42px Fredoka,
    sans-serif;
  margin: 6px 0;
  color: #3e6552;
}
.town-heading p {
  margin: 8px 0;
  color: #657267;
}
.town-balance {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 290px;
}
.town-balance small {
  width: 100%;
  text-align: right;
  color: #6c7566;
}
.town-balance b {
  font: 500 31px Fredoka;
  color: #82662c;
}
.town-balance button {
  background: #faedc9;
  color: #725b26;
}
.town-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: start;
}
.town-left {
  min-width: 0;
}
.town-scene {
  border: 2px solid #dae2c6;
  border-radius: 26px;
  overflow: hidden;
  background: #dce9c2;
  box-shadow:
    0 8px 0 #c9d7b7,
    0 20px 36px #4d6f4f12;
}
.town-sky {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  padding: 36px 18px 24px;
  background: linear-gradient(#d9edf0, #f1f3dd);
  min-height: 140px;
}
.town-sky:after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 120%;
  height: 65px;
  border-radius: 50% 50% 0 0;
  background: #c0d6ae;
  left: -10%;
  bottom: -35px;
}
.town-sign {
  display: block;
  position: relative;
  font: 500 clamp(21px, 2.4vw, 32px) Fredoka;
  color: #426953;
  text-shadow: 0 1px #fff;
  max-width: 90%;
  margin: auto;
  overflow-wrap: anywhere;
}
.town-sky small {
  display: block;
  margin-top: 9px;
  font-size: 12px;
  color: #526f5e;
}
.town-cloud {
  position: absolute;
  color: #fffaf0;
  font-size: 66px;
  z-index: -1;
  line-height: 1;
  animation: town-cloud 16s ease-in-out infinite alternate;
}
.cloud-one {
  left: 5%;
  top: 4px;
}
.cloud-two {
  right: 9%;
  top: 38px;
  font-size: 46px;
  animation-delay: -7s;
}
.town-sun {
  position: absolute;
  right: 3%;
  top: 0;
  color: #ebc16d;
  font-size: 58px;
  z-index: -2;
}
.town-lawn {
  padding: 13px 19px 0;
  background: radial-gradient(ellipse at 50% 35%, #e2ebc9, #c7dba6);
}
.town-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}
.town-cell {
  min-width: 0 !important;
  min-height: 44px !important;
  width: 100%;
  padding: 0 !important;
  aspect-ratio: 1;
  border: 1px solid #95b57d38;
  border-radius: 12px;
  background: #edf3d923;
  position: relative;
  box-shadow: none !important;
  transform: none;
}
.town-cell:nth-child(2n) {
  background: #bbd39b30;
}
.town-cell.empty > span {
  color: #6d956047;
  font-size: 19px;
  font-weight: 400;
}
.town-cell.occupied {
  background: #f8f8df29;
}
.town-cell svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 2px 0 #83a26908);
}
.town-cell:hover {
  background: #fff8df70;
  translate: 0 0;
}
.town-cell.selected {
  border: 2px dashed #738e5e;
  background: #fff8d995;
}
.town-cell.selected:after {
  content: "✓";
  position: absolute;
  right: 0;
  top: 0;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  background: #627e56;
  color: white;
  font-size: 12px;
  display: grid;
  place-items: center;
}
.town-cell:focus-visible {
  outline: 3px solid #8975b5;
  outline-offset: 0;
  z-index: 2;
}
.town-wildflowers {
  color: #e7b2ab;
  text-align: center;
  letter-spacing: 14px;
  padding: 5px;
  font-size: 19px;
}
.town-village-footer {
  padding: 9px 15px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  background: #edf2df;
  font-size: 11px;
  color: #5b7457;
}
.town-village-footer button {
  padding: 8px 10px;
  min-height: 44px;
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
}
.theme-blossom .town-sky {
  background: linear-gradient(#f3e3ed, #fff0e2);
}
.theme-blossom .town-lawn {
  background: radial-gradient(ellipse at 50% 35%, #e6e6c6, #d0d9ad);
}
.theme-blossom .town-sky:after {
  background: #d7d8b7;
}
.theme-sunset .town-sky {
  background: linear-gradient(#f3dab9, #faecd0);
}
.theme-sunset .town-lawn {
  background: radial-gradient(ellipse at 50% 35%, #e4e2b9, #cdd2a0);
}
.town-status {
  font-size: 14px;
  line-height: 1.6;
  background: #f6f1df;
  padding: 12px 16px;
  border-radius: 14px;
  margin: 22px 0 12px;
  border: 1px solid #ebe3c9;
  min-height: 48px;
  color: #675e40;
}
.town-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e4e7d8;
  border-radius: 18px;
  background: #fffdf6;
  min-height: 120px;
}
.town-selected-art {
  width: 85px;
  flex-shrink: 0;
  background: #f0f3e0;
  border-radius: 15px;
}
.town-selected-art svg {
  display: block;
  width: 100%;
}
.town-selected-copy {
  min-width: 0;
}
.town-editor strong {
  font: 500 21px Fredoka;
}
.town-editor p {
  font-size: 13px;
  line-height: 1.6;
  margin: 6px 0;
  color: #687362;
}
.town-item-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.town-item-actions button {
  font-size: 12px;
  padding: 9px 12px;
  min-height: 44px;
}
.town-point {
  font-size: 35px;
  color: #bca05b;
}
.town-colours {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.town-colours button {
  background: var(--paint);
  border: 3px solid #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  box-shadow: 0 0 0 1px #d6daca;
  color: #293e35;
}
.town-colours button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #596e54;
}
.town-residents {
  padding: 19px 8px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.town-residents h3 {
  font: 500 22px Fredoka;
  margin: 0 0 5px;
}
.town-residents p {
  font-size: 12px;
  max-width: 240px;
  color: #6e7869;
  line-height: 1.6;
}
.town-friends {
  display: flex;
  gap: 7px;
}
.town-friends button {
  padding: 0 6px 8px;
  background: #f1eddf;
  width: 78px;
  border-radius: 40px 40px 18px 18px;
  min-height: 105px;
  font-size: 12px;
}
.town-friends svg {
  display: block;
  width: 65px;
  max-width: 100%;
}
.town-customise {
  border: 1px solid #e2e4d6;
  border-radius: 15px;
  padding: 14px 17px;
  background: #fffdf8;
}
.town-customise summary {
  cursor: pointer;
  font-size: 14px;
  min-height: 28px;
  font-weight: 600;
}
#townSettings {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  align-items: end;
  margin-top: 15px;
}
#townSettings label {
  font-size: 12px;
  display: grid;
  gap: 7px;
  flex: 1;
  min-width: 160px;
}
#townSettings input,
#townSettings select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d9ddcd;
  border-radius: 10px;
  background: #fff;
}
aside.town-workshop {
  display: block !important;
  background: #fffcf5 !important;
  border: 1px solid #e8e1d2;
  border-radius: 24px;
  padding: 18px !important;
  width: auto !important;
  min-width: 0;
  position: static !important;
  height: auto !important;
  box-shadow: 0 6px 0 #eae4d5;
}
.town-workshop-head h3 {
  font: 500 25px Fredoka;
  margin: 7px 0;
}
.town-workshop-head p {
  font-size: 12px;
  color: #73806d;
  margin: 6px 0 16px;
}
.town-tabs {
  display: flex;
  gap: 7px;
  background: #efeddf;
  padding: 5px;
  border-radius: 14px;
}
.town-tabs button {
  flex: 1;
  background: transparent;
  border-radius: 10px;
  padding: 10px 6px;
  font-size: 13px;
  min-height: 44px;
}
.town-tabs button[aria-pressed="true"] {
  background: #fffdf5;
  box-shadow: 0 2px 5px #5c644516;
}
.town-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 15px 0;
  font-size: 12px;
  color: #5f6f59;
}
.town-filter select {
  padding: 10px;
  border-radius: 9px;
  border: 1px solid #dce0d0;
  max-width: 100%;
  min-width: 0;
  flex: 1;
  background: #fffdf8;
}
.town-shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.town-shop-card {
  border: 1px solid #e4e6d7;
  border-radius: 16px;
  padding: 10px;
  background: white;
  min-width: 0;
  text-align: center;
}
.town-shop-art {
  margin: 0 auto 4px;
  max-width: 90px;
  aspect-ratio: 1;
  background: radial-gradient(#f2f4df, transparent 70%);
}
.town-shop-art svg {
  display: block;
  width: 100%;
  height: 100%;
}
.town-shop-card h4 {
  font: 500 15px Fredoka;
  margin: 4px 0 7px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.town-shop-card p {
  font-size: 11px;
  color: #6e7867;
  line-height: 1.6;
  margin: 0 0 8px;
}
.town-shop-card p b {
  color: #84652c;
  font-size: 14px;
}
.town-shop-card p span {
  display: block;
}
.town-shop-card button {
  padding: 9px 4px;
  min-height: 44px;
  width: 100%;
  background: #e8efdc;
  font-size: 11px;
  border-radius: 10px;
}
.town-shop-card button:disabled {
  opacity: 1;
  background: #f3f1e9;
  color: #797b6c;
  cursor: default;
  translate: 0 0;
}
.town-shop-note {
  margin-top: 18px;
  border-radius: 15px;
  padding: 16px;
  background: #f0ecd9;
  color: #62684f;
}
.town-shop-note b {
  font: 500 18px Fredoka;
}
.town-shop-note p {
  font-size: 11px;
  line-height: 1.7;
}
.town-shop-note button {
  font-size: 12px;
  background: #fffaf0;
}
.town-home-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  border: 1px solid #d7e0c6;
  background: linear-gradient(110deg, #e9efd9, #f7e7d8 70%, #f1e1ea);
  border-radius: 23px;
  margin: 22px 0;
}
.town-home-banner .town-banner-art {
  width: 100px;
  flex-shrink: 0;
}
.town-banner-art svg {
  display: block;
  width: 100%;
}
.town-home-banner h3 {
  font: 500 25px Fredoka;
  margin: 0 0 7px;
}
.town-home-banner p {
  font-size: 13px;
  margin: 0;
  color: #65725d;
}
.town-home-banner button {
  margin-left: auto;
  white-space: nowrap;
  background: #fffaf0;
}
@keyframes town-cloud {
  from {
    transform: translateX(-7px);
  }
  to {
    transform: translateX(12px);
  }
}
@keyframes town-hop {
  0%,
  80%,
  100% {
    transform: translateY(0);
  }
  87% {
    transform: translateY(-4px);
  }
  94% {
    transform: translateY(-1px);
  }
}
@keyframes town-mill {
  to {
    transform: rotate(360deg);
  }
}
.mill-sails {
  animation: town-mill 24s linear infinite;
}
.town-friends .rabbit-hop {
  animation: town-hop 5s ease-in-out infinite;
}
.town-friends button:nth-child(2) .rabbit-hop {
  animation-delay: 1.5s;
}
.town-friends button:nth-child(3) .rabbit-hop {
  animation-delay: 2.7s;
}
.town-paused * {
  animation-play-state: paused !important;
}
@media (min-width: 1600px) {
  .town-layout {
    grid-template-columns: minmax(0, 1.9fr) minmax(290px, 1fr);
  }
  .town-shop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .town-layout {
    grid-template-columns: 1fr;
  }
  .town-workshop {
    margin-top: 4px;
  }
  .town-shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .town-shop-art {
    max-width: 100px;
  }
  .town-heading h2 {
    font-size: 36px;
  }
}
@media (max-width: 650px) {
  .town-heading {
    align-items: flex-start;
    gap: 12px;
  }
  .town-heading h2 {
    font-size: 30px;
  }
  .town-heading p {
    font-size: 12px;
    line-height: 1.6;
  }
  .town-kicker {
    font-size: 9px;
    letter-spacing: 1.4px;
  }
  .town-balance {
    max-width: 120px;
    gap: 7px;
  }
  .town-balance b {
    font-size: 25px;
  }
  .town-balance small {
    font-size: 10px;
  }
  .town-balance button {
    font-size: 11px;
    padding: 10px;
    min-height: 44px;
  }
  .town-layout {
    gap: 16px;
  }
  .town-lawn {
    padding: 10px 6px 0;
  }
  .town-grid {
    gap: 1px;
  }
  .town-cell {
    border-radius: 7px;
  }
  .town-sky {
    padding: 28px 10px 20px;
    min-height: 120px;
  }
  .town-sign {
    font-size: 25px;
  }
  .town-village-footer {
    padding: 6px;
    font-size: 9px;
  }
  .town-village-footer button {
    font-size: 10px;
    padding: 5px;
  }
  .town-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .town-residents {
    align-items: flex-start;
    flex-direction: column;
  }
  .town-residents p {
    max-width: none;
  }
  .town-editor {
    padding: 12px;
    gap: 10px;
    align-items: flex-start;
  }
  .town-selected-art {
    width: 55px;
  }
  .town-item-actions {
    gap: 5px;
  }
  .town-item-actions button {
    font-size: 11px;
    padding: 8px;
  }
  .town-colours {
    gap: 4px;
  }
  .town-home-banner {
    padding: 15px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .town-home-banner .town-banner-art {
    width: 65px;
  }
  .town-home-banner > div:not(.town-banner-art) {
    flex: 1;
  }
  .town-home-banner h3 {
    font-size: 22px;
  }
  .town-home-banner button {
    width: 100%;
    margin: 0;
  }
  .town-status {
    font-size: 12px;
  }
  .town-shop-card h4 {
    font-size: 17px;
  }
  .town-shop-card button {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rabbit-town * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
