/* ═════════ Town Hall — Mayor Hazel + decorate the town ═════════ */
.th {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: max(0.6rem, env(safe-area-inset-top)) max(0.6rem, env(safe-area-inset-right)) max(0.6rem, env(safe-area-inset-bottom)) max(0.6rem, env(safe-area-inset-left));
  background: rgba(38, 50, 56, 0.45);
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  color: #263238;
}
.th[hidden] {
  display: none;
}
.th__card {
  position: relative;
  width: min(58rem, 100%);
  max-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-radius: 1.6rem;
  background: #fffaf0;
  border: 5px solid #263238;
  box-shadow: 0 8px 0 rgba(38, 50, 56, 0.35);
  animation: th-pop 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
  overflow: hidden;
}
@keyframes th-pop {
  0% { transform: scale(0.88); }
  100% { transform: scale(1); }
}
.th__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem 0.55rem;
  background: linear-gradient(180deg, #2a9d8f, #1f7a6f);
  border-bottom: 4px solid #263238;
  color: #fff;
}
.th__title {
  margin: 0;
  flex: 1;
  font-size: 1.45rem;
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(38, 50, 56, 0.5);
}
.th__purse {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: #fff3c4;
  border: 3px solid #263238;
  color: #263238;
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
}
.th-wood {
  font-weight: 800;
  white-space: nowrap;
}
.th__close {
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #ff9800;
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 3px 0 rgba(38, 50, 56, 0.35);
  cursor: pointer;
}
.th__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.8rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* ── the mayor: leader card + speech bubble ── */
.th-mayor {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.th-mayor__face {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 9.5rem;
}
.th-mayor__frame {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  border: 5px solid #ffd54f;
  box-shadow: 0 0 0 4px #263238, 0 6px 0 4px rgba(38, 50, 56, 0.35);
  overflow: hidden;
  background: #b39ddb;
}
.th-owl {
  display: block;
  width: 100%;
  height: 100%;
}
.th-blink {
  transform-origin: 60px 52px;
  animation: th-blink 4.5s infinite;
}
@keyframes th-blink {
  0%, 94%, 100% { transform: scaleY(1); }
  97% { transform: scaleY(0.1); }
}
.th-mayor__plate {
  margin-top: -0.6rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.3rem 0.55rem 0.35rem;
  border-radius: 0.8rem;
  background: #7e57c2;
  border: 3px solid #263238;
  color: #fff;
  text-align: center;
  line-height: 1.15;
}
.th-mayor__plate b {
  font-size: 0.92rem;
}
.th-mayor__plate span {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.95;
}
.th-stars {
  margin-top: 0.15rem;
  font-size: 0.8rem !important;
  letter-spacing: -0.05em;
}
.th-star-off {
  filter: grayscale(1) opacity(0.4);
}
.th-stars__label {
  display: block;
  letter-spacing: 0;
  font-size: 0.66rem;
}

.th-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 0.8rem 1rem 0.7rem;
  border-radius: 1.4rem;
  background: #fff;
  border: 4px solid #263238;
  box-shadow: 0 5px 0 rgba(38, 50, 56, 0.25);
}
.th-bubble::before {
  content: "";
  position: absolute;
  left: -1.05rem;
  top: 2.2rem;
  border: 0.55rem solid transparent;
  border-right: 0.75rem solid #263238;
}
.th-bubble::after {
  content: "";
  position: absolute;
  left: -0.62rem;
  top: 2.42rem;
  border: 0.34rem solid transparent;
  border-right: 0.5rem solid #fff;
}
.th-bubble__text {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
}
.th-bubble__text.is-pop {
  animation: th-say 0.35s ease-out;
}
@keyframes th-say {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: none; }
}
.th-bubble__btns {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.th-bubble__btn {
  min-width: 2.8rem;
  height: 2.6rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 3px solid #263238;
  background: #e3f2fd;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 3px 0 #263238;
  cursor: pointer;
}
.th-bubble__btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #263238;
}
.th-bubble__btn--next {
  background: #43a047;
  color: #fff;
  text-shadow: 0 2px 0 rgba(38, 50, 56, 0.45);
}
.th-bubble__btn[hidden] {
  display: none;
}

/* ── shop ── */
.th-shop__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.th-shop__title {
  margin: 0;
  flex: 1;
  font-size: 1.2rem;
  font-weight: 800;
}
.th-shop__pickup {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 3px solid #263238;
  background: #ffe0b2;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 3px 0 #263238;
  cursor: pointer;
  white-space: nowrap;
}
.th-shop__pickup:disabled {
  opacity: 0.45;
  cursor: default;
}
.th-shop__tip {
  margin: 0.25rem 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  opacity: 0.8;
}
.th-sec__title {
  margin: 0.5rem 0 0.3rem;
  font-size: 1rem;
  font-weight: 800;
}
.th-row {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0.25rem 0.15rem 0.7rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.th-item {
  position: relative;
  flex: 0 0 9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0.4rem 0.5rem;
  border-radius: 1.1rem;
  border: 4px solid #263238;
  background: #fff;
  box-shadow: 0 4px 0 #263238;
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
  scroll-snap-align: start;
}
.th-item:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #263238;
}
.th-item.is-track {
  background: #fff8e1;
}
.th-item.is-poor {
  background: #f5f5f5;
}
.th-item.is-poor .th-item__pic img {
  filter: saturate(0.4) opacity(0.75);
}
.th-item.is-shake {
  animation: th-shake 0.35s ease-out;
}
@keyframes th-shake {
  25% { transform: translateX(-6px) rotate(-3deg); }
  75% { transform: translateX(6px) rotate(3deg); }
}
.th-item__pic {
  width: 100%;
  height: 5.6rem;
  border-radius: 0.7rem;
  background: #e8f5e9;
  overflow: hidden;
}
.th-item.is-track .th-item__pic {
  background: #fff3e0;
}
.th-item__pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.th-item__name {
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.1;
}
.th-item__blurb {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.7;
  line-height: 1.15;
  min-height: 1.7em;
}
.th-item__cost {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.1rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #fff3c4;
  border: 2px solid #263238;
  font-weight: 800;
  font-size: 0.92rem;
}
.th-item.is-poor .th-item__cost {
  background: #eceff1;
}
.th-item__count {
  position: absolute;
  top: 0.3rem;
  right: 0.35rem;
  z-index: 1;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #43a047;
  border: 2px solid #263238;
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
}

/* phones: mayor stacks above the bubble */
@media (max-width: 560px) {
  .th-mayor {
    flex-direction: column;
    gap: 0.6rem;
  }
  .th-mayor__face {
    flex-direction: row;
    width: auto;
    gap: 0.6rem;
  }
  .th-mayor__frame {
    width: 5.6rem;
    height: 5.6rem;
  }
  .th-mayor__plate {
    margin-top: 0;
    align-items: flex-start;
    text-align: left;
  }
  .th-bubble {
    width: 100%;
    box-sizing: border-box;
  }
  .th-bubble::before {
    left: 2.4rem;
    top: -1.05rem;
    border: 0.55rem solid transparent;
    border-bottom: 0.75rem solid #263238;
  }
  .th-bubble::after {
    left: 2.61rem;
    top: -0.62rem;
    border: 0.34rem solid transparent;
    border-bottom: 0.5rem solid #fff;
  }
  .th-bubble__text {
    font-size: 1.12rem;
  }
  .th__title {
    font-size: 1.2rem;
  }
  .th__purse {
    font-size: 0.92rem;
  }
  .th-item {
    flex-basis: 7.6rem;
  }
  .th-item__pic {
    height: 4.6rem;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .th-mayor__frame {
    width: 5rem;
    height: 5rem;
  }
  .th-mayor__face {
    width: 8rem;
  }
  .th-bubble__text {
    font-size: 1.05rem;
  }
  .th-item__pic {
    height: 4.2rem;
  }
}

/* ═════════ Placing things on the map ═════════ */
.aa-place {
  position: absolute;
  left: 50%;
  top: calc(max(0.75rem, env(safe-area-inset-top)) + 3.5rem);
  z-index: 32;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: calc(100% - 1.2rem);
  box-sizing: border-box;
  padding: 0.4rem 0.45rem 0.4rem 0.5rem;
  border-radius: 999px;
  background: #fffaf0;
  border: 4px solid #263238;
  box-shadow: 0 5px 0 rgba(38, 50, 56, 0.3);
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  color: #263238;
  animation: th-say 0.3s ease-out;
}
.aa-place[hidden] {
  display: none;
}
.aa-place__pic {
  width: 2.8rem;
  height: 2.8rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e8f5e9;
  border: 3px solid #263238;
  overflow: hidden;
}
.aa-place__pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.aa-place__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.aa-place__text b {
  font-size: 1rem;
}
.aa-place__text span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.aa-place__btn {
  height: 2.6rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 3px solid #263238;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 3px 0 #263238;
  cursor: pointer;
  white-space: nowrap;
}
.aa-place__btn--shop {
  background: #e3f2fd;
}
.aa-place__btn--done {
  background: #ff9800; /* orange: stop placing (green ✓ under the preview places it) */
  color: #fff;
  text-shadow: 0 2px 0 rgba(38, 50, 56, 0.45);
}
.aa-place.is-pickup .aa-place__pic {
  background: #ffe0b2;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}
@media (max-width: 430px) {
  .aa-place {
    top: calc(max(0.75rem, env(safe-area-inset-top)) + 3rem);
    gap: 0.35rem;
  }
  .aa-place__btn {
    width: 2.7rem;
    padding: 0;
    font-size: 1.15rem;
  }
  .aa-place__lbl {
    display: none;
  }
  .aa-place__text b {
    font-size: 0.95rem;
  }
  .aa-place__text span {
    font-size: 0.8rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .th__card,
  .th-blink,
  .th-bubble__text.is-pop,
  .th-item.is-shake,
  .aa-place {
    animation: none;
  }
}

/* JG-007: station shops reuse this screen without the mayor */
.th-mayor[hidden] {
  display: none;
}
.th[data-shop="garden"] .th__head {
  background: linear-gradient(180deg, #ab47bc, #7b1fa2);
}
.th[data-shop="train"] .th__head {
  background: linear-gradient(180deg, #26a69a, #00796b);
}

/* ═════════ JG-032: Mayor Hazel's quest board + our town ═════════ */
.th-quests[hidden],
.th-town[hidden],
.th-shop[hidden] {
  display: none;
}
/* the hall is a narrower, simpler card than the shops */
.th[data-shop="hall"] .th__card {
  width: min(40rem, 100%);
}
.th__purse.is-pulse {
  animation: th-purse-pulse 0.4s ease-out;
}
@keyframes th-purse-pulse {
  40% { transform: scale(1.12); }
}
.th-quests__list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.4rem;
}
.th-quests__none {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  background: #fff;
  border: 3px dashed #b0bec5;
  font-weight: 700;
  text-align: center;
}
.th-quest {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.4rem 0.6rem;
  box-sizing: border-box;
  border-radius: 0.95rem;
  border: 3px solid #263238;
  background: #fff;
  box-shadow: 0 3px 0 #263238;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.th-quest:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #263238;
}
.th-quest__emoji {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e0f2f1;
  border: 2.5px solid #263238;
  font-size: 1.1rem;
}
.th-quest__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.th-quest__title {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
}
.th-quest__bar {
  display: block;
  height: 0.5rem;
  border-radius: 999px;
  background: #eceff1;
  border: 2px solid #263238;
  overflow: hidden;
}
.th-quest__bar i {
  display: block;
  height: 100%;
  background: linear-gradient(180deg, #81c784, #43a047);
  border-radius: 999px;
  transition: width 0.4s ease-out;
}
.th-quest__side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-weight: 800;
}
.th-quest__count {
  font-size: 0.95rem;
  color: #546e7a;
}
.th-quest__reward {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-size: 0.92rem;
}
.th-quest__happy,
.th-quest__badge {
  font-weight: 800;
}
.th-quest__claim {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #43a047;
  color: #fff;
  text-shadow: 0 1px 0 rgba(38, 50, 56, 0.5);
  font-size: 0.9rem;
  white-space: nowrap;
}
.th-quest__got {
  color: #2e7d32;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.th-quest.is-done {
  background: #f1f8e9;
  animation: th-quest-glow 1.2s ease-in-out infinite;
}
.th-quest.is-done .th-quest__emoji {
  background: #ffd54f;
}
@keyframes th-quest-glow {
  50% {
    box-shadow:
      0 4px 0 #263238,
      0 0 0 6px rgba(255, 213, 79, 0.7);
  }
}
.th-quest.is-claimed {
  animation: th-quest-claim 0.5s cubic-bezier(0.34, 1.6, 0.64, 1);
  background: #e8f5e9;
  pointer-events: none;
}
@keyframes th-quest-claim {
  0% { transform: scale(1); }
  40% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.th-quest.is-new {
  animation: th-quest-in 0.45s cubic-bezier(0.34, 1.5, 0.64, 1);
}
@keyframes th-quest-in {
  0% { transform: translateY(12px) scale(0.92); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
.th-quest.is-shake {
  animation: th-shake 0.35s ease-out;
}

/* our town: one line of small stats + badges, no boxes */
.th-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #546e7a;
}
.th-tile {
  white-space: nowrap;
}
.th-tile b {
  color: #263238;
  font-weight: 800;
}
.th-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.45rem;
}
.th-badges__label {
  font-weight: 800;
  font-size: 0.88rem;
  margin-right: 0.15rem;
}
.th-badge {
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff59d, #ffca28 70%);
  border: 2px solid #263238;
  font-size: 0.9rem;
}
.th-badge.is-locked {
  background: #eceff1;
  color: #b0bec5;
  font-weight: 800;
  box-shadow: none;
  border-style: dashed;
  border-color: #b0bec5;
}
.th-badge.is-new {
  animation: th-badge-new 0.9s cubic-bezier(0.34, 1.6, 0.64, 1);
}
@keyframes th-badge-new {
  0% { transform: scale(0.3) rotate(-30deg); }
  60% { transform: scale(1.35) rotate(10deg); }
  100% { transform: none; }
}
@media (max-width: 640px) {
  /* emoji on the left; title + bar, then count / claim + reward on a row under it */
  .th-quest {
    display: grid;
    grid-template-columns: 2.1rem minmax(0, 1fr);
    column-gap: 0.65rem;
    row-gap: 0.35rem;
    align-items: center;
  }
  .th-quest__emoji {
    grid-row: span 2;
  }
  .th-quest__side {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .th-quest__reward {
    font-size: 0.85rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .th-quest.is-done,
  .th-quest.is-claimed,
  .th-quest.is-new,
  .th-quest.is-shake,
  .th-badge.is-new {
    animation: none;
  }
}

/* the Town Hall pop-up when a quest is waiting */
.aa-bubble.is-quest {
  animation: aa-quest-bob 1s ease-in-out infinite;
}
@keyframes aa-quest-bob {
  50% { translate: 0 -6px; scale: 1.06; }
}
.aa-bubble.is-hall.is-quest {
  background: #ffe082;
}
@media (prefers-reduced-motion: reduce) {
  .aa-bubble.is-quest { animation: none; }
}

/* ═════════ JG-031: placing preview — ✓ / ↻ under the ghost ═════════ */
.aa-ghost-btns {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 26;
  display: flex;
  gap: 0.5rem;
  pointer-events: auto;
  will-change: transform;
}
.aa-ghost-btns[hidden] {
  display: none;
}
.aa-ghost-btn {
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 4px solid #263238;
  box-shadow: 0 4px 0 #263238;
  font: inherit;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 0 rgba(38, 50, 56, 0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.aa-ghost-btn[hidden] {
  display: none;
}
.aa-ghost-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #263238;
}
.aa-ghost-btn--ok {
  background: #43a047;
  animation: aa-ghost-ok 1.1s ease-in-out infinite;
}
.aa-ghost-btn--ok:disabled {
  background: #b0bec5;
  animation: none;
  cursor: not-allowed;
}
.aa-ghost-btn--rot {
  background: #42a5f5;
}
/* JG-056: 🪓 clear the trees / bushes / rocks under the ghost */
.aa-ghost-btn--clear {
  background: #ff8f00;
  font-size: 1.4rem;
}
@keyframes aa-ghost-ok {
  50% { box-shadow: 0 4px 0 #263238, 0 0 0 6px rgba(105, 240, 174, 0.55); }
}
@media (prefers-reduced-motion: reduce) {
  .aa-ghost-btn--ok { animation: none; }
}

/* JG-058: shop items wrap into rows and the shop only scrolls up and down (no sideways rows) */
.th-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.6rem, 1fr));
  overflow: visible;
  scroll-snap-type: none;
}
.th-item {
  flex: none;
  min-width: 0;
}
@media (max-width: 560px) {
  .th-row {
    grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
    gap: 0.5rem;
  }
}

/* ── JG-055: 📇 people you've met (the Friends House, next to the Town Hall) ── */
.th-people[hidden] {
  display: none;
}
.th[data-shop="friends"] .th__card {
  width: min(40rem, 100%);
}
.th[data-shop="friends"] .th__head {
  background: linear-gradient(180deg, #ec407a, #c2185b);
}
.th[data-shop="friends"] .th__purse:empty {
  display: none;
}
.th-people__n {
  margin-left: 0.3rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: #fff3c4;
  border: 2px solid rgba(38, 50, 56, 0.25);
  font-size: 0.85rem;
}
.th-people__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr));
  gap: 0.5rem;
}
.th-person-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.35rem 0.3rem 0.45rem;
  border-radius: 1rem;
  border: 3px solid #263238;
  background: #fff;
  box-shadow: 0 3px 0 #263238;
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
  min-width: 0;
}
.th-person-card:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #263238;
}
.th-person-card__face {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.8rem;
  border-radius: 0.8rem;
  background: linear-gradient(#e3f2fd, #e8f5e9);
  overflow: hidden;
}
.th-person-card__face canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.th-person-card__name {
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.1;
}
.th-person-card__title {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.7;
  line-height: 1.1;
}
.th-person-card.is-unknown {
  cursor: default;
  border-style: dashed;
  border-color: rgba(38, 50, 56, 0.35);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
}
.th-person-card.is-unknown .th-person-card__face {
  background: #eceff1;
}
.th-person-card__q {
  font-size: 2rem;
  font-weight: 800;
  color: #b0bec5;
}
/* JG-062: a friend's full details take the list's place (same look as the map's character panel) */
.th-friend {
  --char: #ec407a;
  animation: th-friend-in 0.22s ease-out;
}
.th-friend[hidden] {
  display: none;
}
@keyframes th-friend-in {
  from {
    transform: translateX(8%);
    opacity: 0;
  }
}
.th-people.is-detail > .th-shop__head,
.th-people.is-detail > .th-shop__tip,
.th-people.is-detail > .th-people__grid {
  display: none;
}
.th-friend__back {
  margin: 0 0 0.6rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 3px solid #263238;
  background: #fffaf0;
  box-shadow: 0 3px 0 #263238;
  color: #263238;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}
.th-friend__back:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #263238;
}
.th-friend__card {
  border-radius: 1.3rem;
  border: 4px solid #263238;
  background: #fffaf0;
  box-shadow: 0 4px 0 rgba(38, 50, 56, 0.3);
  overflow: hidden;
}
.th-friend__card .aa-char__hero {
  padding-right: 0.9rem;
}
.th-friend__card .aa-char__body {
  overflow: visible;
}
@media (max-width: 560px) {
  .th-people__grid {
    grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr));
    gap: 0.4rem;
  }
  .th-person-card__face {
    width: 3.8rem;
    height: 4rem;
  }
  .th-friend__card .aa-char__name {
    font-size: 1.6rem;
  }
}

/* JG-073: hearts on each friend, 💖 on best friends */
.th-person-card {
  position: relative;
}
.th-person-card__hearts {
  font-size: 0.78rem;
  font-weight: 800;
  color: #d81b60;
}
.th-person-card__best {
  position: absolute;
  top: 0.2rem;
  right: 0.3rem;
  font-size: 1.2rem;
  filter: drop-shadow(0 1px 0 rgba(38, 50, 56, 0.35));
}
.th-person-card__new {
  position: absolute;
  top: 0.15rem;
  left: 0.2rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.6rem;
  background: #e91e63;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}
