/* Janelas compactas: quatro produtos por linha, oito por página. */
#window {
  width: min(760px, 94vw);
  height: auto;
  max-height: 86dvh;
  border-width: 4px;
  border-radius: 15px;
}
#window .title {
  height: 56px;
  font-size: 24px;
  padding: 9px 55px;
}
.window-emblem {
  left: 15px;
  width: 37px;
  height: 37px;
}
#window .title button {
  right: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  font: 23px/23px Arial;
  border-radius: 8px;
}
#window .title:after {
  height: 5px;
  bottom: -5px;
}
#windowBody {
  height: auto;
  max-height: calc(86dvh - 64px);
  padding: 16px 20px 18px;
}
.window-intro {
  padding-bottom: 12px;
  margin-bottom: 12px;
  gap: 10px;
}
.window-intro .eyebrow {
  display: none;
}
.window-intro p {
  font: 13px/1.4 Arial;
  margin: 0;
}
.window-wallet {
  gap: 6px;
}
.window-wallet > span {
  font-size: 11px;
  padding: 4px 8px;
}
.window-wallet img {
  width: 20px;
  height: 20px;
}
#window .tabs {
  position: static;
  padding: 0 0 12px;
  margin: 0;
  gap: 6px;
  background: none;
}
#window .tabs button {
  font: 600 11px Arial;
  padding: 8px 13px;
  border-radius: 8px;
}
#window .shop-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 183px;
  gap: 10px;
}
#window .seed {
  padding: 9px 8px;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: 0 2px 0 #d8d7b92b;
}
#window .seed > img {
  height: 63px;
  width: 85px;
  padding: 2px;
  object-fit: contain;
  flex: none;
}
#window .seed > b {
  font: bold 14px/18px Georgia;
  margin: 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
#window .seed small {
  font: 10px/1.5 Arial;
  margin: 0;
  color: #87906e;
}
.seed-prices {
  display: flex;
  gap: 5px;
  width: 100%;
  margin-top: auto;
}
#window .seed .buy-seed {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding: 5px 4px;
  border-radius: 7px;
  font: 10px Arial;
  min-height: 33px;
}
#window .seed .buy-seed img {
  width: 19px;
  height: 19px;
  padding: 0;
  background: none;
  flex: none;
}
#window .seed .buy-seed span {
  display: block;
  font: 9px/1.2 Arial;
  text-align: left;
}
#window .seed .buy-seed strong {
  display: block;
  font: bold 11px/1.3 Arial;
}
#window .seed .mv-buy {
  margin: 0;
  background: #e6f1dd;
  border-color: #a7c38f;
}
#window .seed .vip-tag {
  top: 7px;
  right: 6px;
  font-size: 8px;
  padding: 2px 4px;
}
.seed-lock {
  position: absolute;
  top: 7px;
  left: 6px;
  font: 8px Arial;
  color: #a48c61;
}
.shop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  font: 10px Arial;
  color: #8b9278;
}
.shop-footer > div {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}
.shop-footer button {
  width: 27px;
  height: 27px;
  border: 1px solid #ccd6b6;
  border-radius: 6px;
  background: #f4f6e9;
  color: #687c46;
  font: 20px Arial;
}
.shop-footer b {
  font: 11px Arial;
}
#window .empty {
  min-height: 160px;
  padding: 22px;
  gap: 13px;
  font: 16px/1.5 Georgia;
  border-radius: 12px;
}
#window .empty img {
  width: 55px;
  height: 55px;
}
#window .items {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
#window .item {
  padding: 13px 10px;
  border-radius: 11px;
}
#window .item img {
  height: 56px;
}
#window .item p {
  font-size: 14px;
  margin: 9px 0;
}
#window .item > b {
  font-size: 10px;
}
#window .classic-button,
#window .item button {
  padding: 9px 15px;
  font-size: 12px;
  border-radius: 8px;
  margin-top: 10px;
}
#window .classic-form {
  padding: 16px 20px;
  border-radius: 12px;
  max-width: 450px;
}
#window .classic-form label {
  font-size: 11px;
  margin: 10px 0 4px;
}
#window input,
#window select {
  padding: 9px;
  font-size: 12px;
}
#window .avatar-options {
  margin: 18px 0;
  gap: 10px;
}
#window .avatar-options img {
  width: 61px;
  height: 61px;
  border-radius: 9px;
}
#window .friend-search {
  padding: 13px;
  border-radius: 10px;
  margin-bottom: 10px;
}
#window .friend-search label {
  font-size: 11px;
  margin-bottom: 7px;
}
#window .friend-row {
  padding: 10px;
  border-radius: 9px;
}
#window .friend-row > img {
  width: 38px;
  height: 38px;
}
#window .friend-row b {
  font-size: 14px;
}
#window .friend-row button {
  padding: 7px 9px;
  font-size: 10px;
}
#windowBody h3 {
  font-size: 17px;
  margin: 16px 0 10px;
}
#window .gift-list li {
  font-size: 11px;
  padding: 9px 12px;
}
#window .vip-intro {
  padding: 16px;
  margin: 0 0 13px;
  border-radius: 12px;
}
#window .vip-intro > b {
  font-size: 23px;
}
#window .vip-intro p {
  font-size: 12px;
  margin: 10px 0;
}
#window .vip-plans {
  gap: 10px;
}
#window .vip-plans > div {
  padding: 18px 11px;
  border-radius: 12px;
}
#window .vip-plans > div > b {
  font-size: 16px;
}
#window .vip-plans p {
  font-size: 11px;
}
#window .muted {
  font-size: 10px;
}
#window .vip-plans .classic-button {
  font-size: 10px;
  padding: 9px 6px;
}
.expansion-layout {
  gap: 20px;
  padding: 0;
}
.expansion-preview {
  padding: 18px;
  border-radius: 12px;
}
.mini-field {
  width: 125px;
  height: 100px;
  margin: 10px 0 15px;
}
.field-number {
  font-size: 8px;
  padding: 5px 9px;
}
.expansion-preview h3 {
  font-size: 18px !important;
  margin: 12px 0 8px !important;
}
.expansion-preview p {
  font-size: 11px;
  line-height: 1.6;
}
.expansion-details h3 {
  font-size: 20px !important;
  margin: 6px 0 13px !important;
}
.eyebrow {
  font-size: 9px;
}
.requirement {
  padding: 9px;
  font-size: 10px;
  border-radius: 8px;
}
.requirement b {
  font-size: 17px;
}
.requirement small {
  font-size: 9px;
}
.cost-label {
  font-size: 11px;
  margin-top: 15px;
}
.cost-label small {
  font-size: 9px;
}
.land-costs {
  gap: 6px;
}
.land-costs > div {
  padding: 9px 6px;
  grid-template-columns: 24px 1fr;
  gap: 3px 4px;
  border-radius: 8px;
}
.land-costs img {
  width: 23px;
  height: 23px;
}
.land-costs b {
  font-size: 12px;
}
.land-costs small {
  font-size: 8px;
}
.expansion-buy {
  margin-top: 15px !important;
  padding: 11px !important;
}
.expansion-buy span {
  font-size: 9px;
}
.purchase-note {
  font-size: 10px;
}
.seed-confirm {
  display: flex;
  gap: 24px;
  align-items: center;
  max-width: 480px;
  margin: 7px auto 18px;
}
.confirm-crop {
  width: 100px;
  height: 100px;
  object-fit: contain;
  background: radial-gradient(#e8edcd, transparent 70%);
}
.seed-confirm > div {
  flex: 1;
}
.seed-confirm h3 {
  font-size: 21px !important;
  margin: 5px 0 8px !important;
}
.seed-confirm p,
.seed-confirm small {
  font: 12px/1.5 Arial;
  color: #8a9475;
}
.confirm-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-block: 1px solid #dce1c9;
  padding: 12px 0;
  margin: 12px 0;
  font: 12px Arial;
}
.confirm-total b {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #627e38;
  font-size: 16px;
}
.confirm-total img {
  width: 25px;
  height: 25px;
}
.confirm-hint {
  font-size: 10px !important;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid #dce1c9;
  padding-top: 14px;
}
.confirm-actions .classic-button {
  margin: 0 !important;
}
.secondary-button {
  border: 1px solid #c8d0b1;
  border-radius: 8px;
  background: #f4f1e3;
  padding: 9px 14px;
  color: #7a8468;
  font: 12px Arial;
}
#purchaseError {
  font: 12px Arial;
  color: #b06a48;
  text-align: center;
}
@media (max-width: 600px) {
  #window {
    width: 96vw;
    max-height: 90dvh;
  }
  #windowBody {
    max-height: calc(90dvh - 64px);
    padding: 13px;
  }
  .window-intro {
    flex-direction: row;
    align-items: center;
  }
  .window-intro p {
    font-size: 11px;
    max-width: 150px;
  }
  .window-wallet {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .window-wallet > span {
    font-size: 10px;
    padding: 3px 6px;
  }
  #window .shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 174px;
    gap: 5px;
  }
  #window .seed {
    padding: 7px 4px;
  }
  #window .seed > img {
    width: 55px;
    height: 55px;
  }
  #window .seed > b {
    font-size: 11px;
  }
  #window .seed small {
    font-size: 8px;
  }
  #window .seed .buy-seed {
    padding: 4px 2px;
    gap: 2px;
    flex-wrap: wrap;
  }
  #window .seed .buy-seed img {
    width: 15px;
    height: 15px;
  }
  #window .seed .buy-seed span {
    font-size: 8px;
  }
  #window .seed .buy-seed strong {
    font-size: 9px;
  }
  .seed-prices {
    gap: 3px;
  }
  #window .tabs button {
    padding: 7px 9px;
    font-size: 10px;
  }
  #window .tabs {
    gap: 4px;
    overflow-x: auto;
  }
  .shop-footer > span {
    font-size: 9px;
    max-width: 175px;
  }
  .expansion-layout {
    grid-template-columns: 1fr;
  }
  .expansion-preview {
    display: none;
  }
  #window .vip-plans {
    grid-template-columns: 1fr;
  }
  #window .items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .seed-confirm {
    gap: 12px;
  }
  .confirm-crop {
    width: 65px;
    height: 65px;
  }
  .seed-confirm h3 {
    font-size: 18px !important;
  }
  .confirm-total b {
    font-size: 13px;
  }
  .confirm-actions {
    justify-content: space-between;
  }
  .confirm-actions button {
    font-size: 11px !important;
  }
}

#window {
  height: fit-content;
  margin: auto;
}
#window .seed .seed-lock {
  font: 8px/1.2 Arial;
  max-width: 90px;
  text-align: left;
  background: #fff8e2cc;
  border-radius: 3px;
  padding: 2px 3px;
  z-index: 1;
}
#window .seed .seed-prices span {
  position: static;
}

/* Every shop category keeps a stable four-by-two page, including touch screens. */
#window .shop-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(145px, 1fr));
  grid-auto-rows: 145px;
  min-height: 0;
}
#window .seed {
  min-width: 0;
  min-height: 0;
}
#window .seed > b {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.2;
  max-height: 2.4em;
}
#window .seed small {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 700px) and (orientation: landscape) {
  #window {
    width: min(94vw, 850px);
    max-height: 88dvh;
  }
  #window .shop-grid {
    grid-template-rows: repeat(2, minmax(110px, 1fr));
    grid-auto-rows: 110px;
    gap: 5px;
  }
  #window .seed {
    padding: 5px 4px;
  }
  #window .seed > img {
    width: 48px;
    height: 46px;
  }
  #window .seed > b {
    font-size: 10px;
    line-height: 1.15;
    margin: 2px 0;
  }
  #window .seed small {
    font-size: 8px;
    line-height: 1.2;
  }
  #window .seed-prices {
    height: 34px;
    gap: 3px;
  }
  #window .seed .buy-seed {
    height: 34px;
    min-height: 34px;
  }
  #window .seed .buy-seed img {
    width: 13px;
    height: 13px;
  }
  #window .seed .buy-seed span {
    font-size: 7px;
  }
  #window .seed .buy-seed strong {
    font-size: 9px;
  }
  #window .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  #window .tabs button {
    flex: none;
    min-height: 38px;
  }
  .shop-footer button {
    width: 38px;
    height: 36px;
  }
  #hudActions > button,
  #hudActions > a {
    min-height: 38px;
  }
  #toolbar button {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }
}

/* VIP ribbon and clearer card hierarchy without changing the shop grid size. */
#window .seed .vip-tag {
  position: absolute;
  left: 0;
  right: auto;
  top: 12px;
  width: 20px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 4px 2px;
  border: 0;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #a86bd0, #70419d);
  color: #fff;
  font: 700 9px Arial;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  z-index: 2;
  box-shadow: 0 2px 5px #43205055;
}
#window .seed:has(.vip-tag) {
  padding-left: 24px;
}
#window .seed .seed-level {
  margin: 2px 0 5px;
  color: #6e824d;
  font: bold 9px/1.2 Arial;
}
#window .seed .seed-details {
  margin: 0;
  color: #8a9276;
  font: 9px/1.35 Arial;
}
#window[data-kind="shop"] .seed .seed-prices {
  margin-top: auto;
}
#window .bag-grid .feed-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
#window .sound-settings {
  max-width: 420px;
  margin: 0 auto;
  padding: 8px 4px;
}
#window .sound-settings > label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  margin: 14px 0;
  color: #536842;
  font: bold 13px Arial;
}
#window .sound-settings output {
  font: 12px Arial;
  color: #758660;
}
#window .sound-settings input[type="range"] {
  grid-column: 1/-1;
  width: 100%;
  accent-color: #6f974c;
  padding: 0;
}
#window .sound-settings .sound-mute {
  display: flex;
  gap: 8px;
  align-items: center;
}
#window .sound-settings .sound-mute input {
  margin: 0;
  accent-color: #6f974c;
}
#hudActions #soundOpen {
  display: grid;
  place-items: center;
  min-width: 32px;
  width: 32px;
  height: 34px;
  padding: 0;
  color: #4f6d36;
  font: 20px Arial;
}
#window[data-kind="shop"] {
  height: min(570px, 82dvh);
  min-height: min(500px, 76dvh);
  max-height: 82dvh;
}
@media (max-width: 700px) {
  #hudActions #soundOpen {
    min-width: 27px;
    width: 27px;
    height: 30px;
    font-size: 17px;
  }
  #window .seed .vip-tag {
    width: 16px;
    height: 43px;
    font-size: 8px;
  }
  #window .seed:has(.vip-tag) {
    padding-left: 19px;
  }
  #window .bag-grid .feed-item img {
    width: 50px;
    height: 50px;
  }
  #window[data-kind="shop"] {
    height: 86dvh;
    min-height: 0;
    max-height: 90dvh;
  }
}

/* VIP is a compact label inside the card. Shop dimensions remain unchanged. */
#window .seed .vip-tag {
  left: 7px !important;
  right: auto !important;
  top: 7px !important;
  width: auto !important;
  height: auto !important;
  display: block !important;
  padding: 3px 7px !important;
  border: 1px solid #9d72bd !important;
  border-radius: 4px !important;
  background: #75449a !important;
  color: #fff !important;
  font: 800 9px/1 Arial !important;
  writing-mode: horizontal-tb !important;
  transform: none !important;
  box-shadow: 0 1px 2px #43205044 !important;
}
#window .seed:has(.vip-tag) {
  padding-left: 8px !important;
}
