:root {
  --ink: #493d4e;
  --ink-soft: #766779;
  --pink: #ed76aa;
  --pink-dark: #c94f86;
  --pink-pale: #fbe1ed;
  --lavender: #9a7fe9;
  --lavender-pale: #eee9ff;
  --mint: #8fd6b7;
  --mint-dark: #4c9d7d;
  --cream: #fffaf2;
  --white: #fffefd;
  --gold: #efbc4f;
  --shadow: 0 22px 70px rgba(96, 63, 94, .17);
  --small-shadow: 0 10px 30px rgba(96, 63, 94, .13);
  --display: "Grandstander", "Trebuchet MS", cursive;
  --body: "DM Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  background:
    radial-gradient(circle at 8% 13%, rgba(255, 255, 255, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 87% 17%, rgba(255, 255, 255, .9) 0 3px, transparent 4px),
    linear-gradient(145deg, #f8deeb, #fff7f1 46%, #e4f6ee);
  background-attachment: fixed;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--pink-dark);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.ambient-sparkles {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-sparkles span {
  position: absolute;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 0 16px rgba(237, 118, 170, .5);
  animation: float-sparkle 6s ease-in-out infinite;
}

.ambient-sparkles span:nth-child(1) { left: 4%; top: 22%; font-size: 1.4rem; }
.ambient-sparkles span:nth-child(2) { left: 92%; top: 30%; font-size: 1.8rem; animation-delay: -2s; }
.ambient-sparkles span:nth-child(3) { left: 80%; top: 85%; font-size: 1rem; animation-delay: -4s; }
.ambient-sparkles span:nth-child(4) { left: 14%; top: 78%; font-size: 1.3rem; animation-delay: -1s; }
.ambient-sparkles span:nth-child(5) { left: 63%; top: 9%; font-size: .9rem; animation-delay: -3s; }
.ambient-sparkles span:nth-child(6) { left: 40%; top: 91%; font-size: 1.2rem; animation-delay: -2.4s; }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto auto;
  align-items: center;
  gap: .75rem;
  min-height: 68px;
  padding: .45rem clamp(.65rem, 2vw, 1.5rem);
  border-bottom: 1px solid rgba(236, 121, 172, .18);
  background: rgba(255, 250, 247, .9);
  box-shadow: 0 8px 28px rgba(88, 57, 84, .08);
  backdrop-filter: blur(18px);
}

.title-mode .site-header {
  display: none;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-button img {
  width: 47px;
  height: 47px;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 5px 16px rgba(221, 97, 153, .22);
}

.brand-button span {
  display: grid;
}

.brand-button b {
  font-family: var(--display);
  font-size: .98rem;
}

.brand-button small {
  margin-top: .1rem;
  color: var(--pink-dark);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.money-pill {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-width: 86px;
  padding: .48rem .75rem;
  border-radius: 999px;
  color: #865c13;
  background: linear-gradient(145deg, #fff1a8, #ffd96b);
  box-shadow: inset 0 1px rgba(255, 255, 255, .7), 0 5px 14px rgba(175, 121, 31, .15);
  font-variant-numeric: tabular-nums;
  justify-content: center;
}

.money-pill span {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
}

.header-nav,
.header-tools {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.header-nav button {
  min-height: 38px;
  padding: .48rem .7rem;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 800;
}

.header-nav button:hover,
.header-nav button.active {
  color: var(--pink-dark);
  background: var(--pink-pale);
}

.round-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(236, 121, 172, .2);
  border-radius: 50%;
  color: var(--pink-dark);
  background: #fff;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
}

.round-button.muted {
  color: #938997;
  background: #f1edf1;
}

main {
  min-height: calc(100svh - 68px);
}

.screen {
  min-height: calc(100svh - 68px);
  padding: clamp(.8rem, 3vw, 2.4rem);
}

.title-mode .screen {
  min-height: 100svh;
}

.screen-title {
  display: grid;
  place-items: center;
}

.title-card {
  display: grid;
  grid-template-columns: minmax(320px, .85fr) minmax(440px, 1.15fr);
  width: min(1220px, 100%);
  min-height: min(735px, calc(100svh - 3rem));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 38px;
  background: rgba(255, 254, 253, .88);
  box-shadow: var(--shadow);
}

.title-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2.2rem, 5vw, 4.8rem);
  background:
    radial-gradient(circle at 35% 18%, rgba(255, 255, 255, .95) 0 2px, transparent 3px),
    linear-gradient(155deg, rgba(255, 253, 253, .98), rgba(255, 235, 246, .95));
}

.eyebrow {
  margin: 0 0 .45rem;
  color: var(--pink-dark);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: var(--display);
}

h1 {
  margin: 0;
  font-size: clamp(3.3rem, 6vw, 6.2rem);
  letter-spacing: -.06em;
  line-height: .86;
}

h1 em {
  color: var(--pink);
  font-style: normal;
  text-shadow: 0 4px rgba(255, 255, 255, .85);
}

.title-intro {
  max-width: 43ch;
  margin: 1.55rem 0 1.25rem;
  color: var(--ink-soft);
  font-size: clamp(.96rem, 1.35vw, 1.1rem);
  line-height: 1.64;
}

.title-features {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.5rem;
}

.title-features span {
  padding: .38rem .65rem;
  border-radius: 999px;
  color: #7a5f88;
  background: var(--lavender-pale);
  font-size: .7rem;
  font-weight: 800;
}

.title-actions,
.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .72rem 1.2rem;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.button:hover {
  filter: brightness(1.025);
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: default;
  filter: grayscale(.25);
  opacity: .55;
  transform: none;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), #dc5894);
  box-shadow: 0 8px 20px rgba(211, 77, 137, .25), inset 0 1px rgba(255, 255, 255, .35);
}

.button-soft {
  color: var(--pink-dark);
  background: var(--pink-pale);
  box-shadow: inset 0 0 0 1px rgba(236, 121, 172, .14);
}

.button.compact {
  min-height: 41px;
  padding: .58rem .9rem;
  border-radius: 13px;
  font-size: .78rem;
}

.porchfield-link {
  margin-top: 1.4rem;
  color: var(--ink-soft);
  font-size: .8rem;
  font-weight: 700;
  text-underline-offset: 4px;
}

.title-visual {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: #bfe9cf;
}

.title-town {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.title-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgba(74, 45, 78, .25), transparent 45%);
  pointer-events: none;
}

.title-nova {
  position: absolute;
  z-index: 2;
  right: -2%;
  bottom: -3%;
  width: min(56%, 470px);
  border: 7px solid rgba(255, 255, 255, .78);
  border-radius: 48% 48% 20% 20%;
  box-shadow: 0 18px 50px rgba(74, 45, 78, .28);
  transform: rotate(1deg);
}

.title-bubble {
  position: absolute;
  z-index: 3;
  top: 8%;
  right: 7%;
  padding: .72rem 1rem;
  border: 3px solid #fff;
  border-radius: 20px 20px 5px 20px;
  color: var(--pink-dark);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--small-shadow);
  font-family: var(--display);
  font-weight: 700;
  transform: rotate(2deg);
}

.world-shell,
.page-shell,
.search-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.narrow-shell {
  width: min(1100px, 100%);
}

.world-heading,
.page-heading,
.search-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin: .2rem 0 1rem;
}

.world-heading h2,
.page-heading h2,
.search-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 4rem);
  letter-spacing: -.045em;
  line-height: .95;
}

.world-heading > p,
.page-heading > div > p:last-child {
  max-width: 60ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: .78rem;
  line-height: 1.5;
}

.touch-help {
  display: none;
}

.world-frame {
  position: relative;
  overflow: hidden;
  border: 7px solid rgba(255, 255, 255, .92);
  border-radius: 28px;
  background: #dff4e8;
  box-shadow: var(--shadow);
}

#town-canvas {
  display: block;
  width: 100%;
  height: min(72svh, 720px);
  min-height: 480px;
  cursor: crosshair;
  touch-action: none;
}

.world-loading {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .65rem;
  color: var(--pink-dark);
  background: linear-gradient(145deg, #fde6f0, #e4f6ee);
  text-align: center;
  transition: opacity .35s ease;
}

.world-loading span {
  font-size: 3rem;
  animation: paw-pulse 1.1s ease-in-out infinite;
}

.world-loading.ready {
  opacity: 0;
  pointer-events: none;
}

.nearby-prompt {
  position: absolute;
  z-index: 7;
  top: 1rem;
  left: 50%;
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .45rem .55rem .45rem .8rem;
  border: 3px solid rgba(255, 255, 255, .92);
  border-radius: 999px;
  color: #fff;
  background: rgba(79, 64, 81, .87);
  box-shadow: 0 8px 25px rgba(61, 38, 62, .25);
  cursor: pointer;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.nearby-prompt span {
  color: #ffd5e7;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nearby-prompt b {
  font-family: var(--display);
}

.nearby-prompt kbd {
  display: grid;
  min-width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  color: var(--pink-dark);
  background: #fff;
  font: 800 .72rem var(--body);
}

.world-shortcuts {
  position: absolute;
  z-index: 8;
  top: .85rem;
  left: .85rem;
  display: flex;
  gap: .4rem;
}

.world-shortcuts button {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: .35rem;
  padding: .48rem .72rem;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  color: var(--pink-dark);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 22px rgba(61, 38, 62, .19);
  cursor: pointer;
  font-size: .75rem;
  font-weight: 800;
  backdrop-filter: blur(9px);
}

.world-shortcuts button:last-child {
  color: #fff;
  background: rgba(214, 83, 143, .92);
}

.touch-controls {
  display: none;
}

.town-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .7rem;
  margin-top: .8rem;
}

.town-quick-actions button {
  min-height: 48px;
  border: 1px solid rgba(236, 121, 172, .15);
  border-radius: 15px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .8);
  box-shadow: var(--small-shadow);
  cursor: pointer;
  font-weight: 800;
}

.town-quick-actions span {
  margin-right: .35rem;
}

.search-heading {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  text-align: center;
}

.search-heading h2 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

.back-button,
.hint-button {
  width: fit-content;
  min-height: 40px;
  padding: .5rem .78rem;
  border: 1px solid rgba(236, 121, 172, .18);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .82);
  cursor: pointer;
  font-size: .76rem;
  font-weight: 800;
}

.hint-button {
  justify-self: end;
  color: var(--pink-dark);
}

.search-instruction {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: .48rem;
  margin: 0 auto .7rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .8);
  font-size: .78rem;
  font-weight: 700;
}

.search-instruction img {
  width: 31px;
  height: 31px;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
}

.search-instruction b {
  color: var(--pink-dark);
}

.search-scene {
  position: relative;
  overflow: hidden;
  width: min(100%, 1120px);
  aspect-ratio: 3 / 2;
  margin: 0 auto;
  border: 7px solid rgba(255, 255, 255, .92);
  border-radius: 26px;
  background: var(--pink-pale);
  box-shadow: var(--shadow);
  cursor: crosshair;
  touch-action: manipulation;
}

.search-scene > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.pet-hotspot {
  position: absolute;
  z-index: 3;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.hint-ring {
  position: absolute;
  z-index: 2;
  display: none;
  border: 4px dashed rgba(255, 255, 255, .95);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(236, 121, 172, .65), 0 0 30px rgba(236, 121, 172, .9);
  pointer-events: none;
  animation: hint-pulse 1.1s ease-in-out infinite;
}

.hint-ring.show {
  display: block;
}

.found-burst {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #fff;
  background: rgba(236, 121, 172, .26);
  font-family: var(--display);
  font-size: clamp(2rem, 7vw, 5rem);
  text-shadow: 0 5px 20px rgba(157, 49, 99, .45);
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.found-burst.show {
  display: flex;
  animation: found-pop .65s cubic-bezier(.2, 1.35, .35, 1);
}

.miss-spark {
  position: absolute;
  z-index: 6;
  color: #fff;
  font-size: 1.8rem;
  text-shadow: 0 0 8px var(--pink);
  pointer-events: none;
  animation: miss-pop .7s ease-out forwards;
  transform: translate(-50%, -50%);
}

.search-tip {
  margin: .7rem 0 0;
  color: var(--ink-soft);
  font-size: .72rem;
  text-align: center;
}

.page-heading {
  align-items: center;
  margin-bottom: 1.3rem;
}

.page-heading > div > p:last-child {
  margin-top: .6rem;
}

.empty-house {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(260px, .9fr);
  overflow: hidden;
  border: 6px solid rgba(255, 255, 255, .88);
  border-radius: 28px;
  background: rgba(255, 255, 255, .84);
  box-shadow: var(--shadow);
}

.empty-house > img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  filter: saturate(.7);
}

.empty-house > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.empty-house h3 {
  margin: 0;
  font-size: 2rem;
}

.empty-house p {
  color: var(--ink-soft);
  line-height: 1.55;
}

.house-scene {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border: 7px solid rgba(255, 255, 255, .92);
  border-radius: 28px;
  background: var(--pink-pale);
  box-shadow: var(--shadow);
}

.house-scene > #house-interior {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.house-nova {
  position: absolute;
  z-index: 2;
  bottom: 4%;
  left: 5%;
  width: 13%;
  max-height: 52%;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(64, 44, 62, .2));
}

.house-pets {
  position: absolute;
  z-index: 3;
  right: 3%;
  bottom: 4%;
  left: 20%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(.1rem, .8vw, .55rem);
}

.house-pet {
  width: min(11.5%, 115px);
  animation: pet-bob 3s ease-in-out infinite;
  filter: drop-shadow(0 7px 7px rgba(58, 39, 57, .2));
}

.house-pet:nth-child(even) {
  animation-delay: -1.5s;
}

.house-pet img {
  width: 100%;
}

.house-nameplate {
  position: absolute;
  z-index: 4;
  top: 4%;
  left: 50%;
  padding: .5rem .8rem;
  border: 3px solid #fff;
  border-radius: 999px;
  color: var(--pink-dark);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--small-shadow);
  font-family: var(--display);
  font-weight: 700;
  transform: translateX(-50%);
}

.pet-family-card {
  margin-top: 1.2rem;
  padding: 1.1rem;
  border: 1px solid rgba(236, 121, 172, .14);
  border-radius: 23px;
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--small-shadow);
}

.pet-family-card h3 {
  margin: 0;
  font-size: 1.5rem;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: .55rem;
  margin-top: .8rem;
}

.family-pet {
  overflow: hidden;
  min-width: 0;
  border-radius: 16px;
  background: var(--pink-pale);
  text-align: center;
}

.family-pet .pet-render-slot {
  aspect-ratio: 1;
}

.family-pet span {
  display: block;
  overflow: hidden;
  padding: .35rem;
  font-size: .62rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-pet.missing {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: rgba(201, 79, 134, .55);
  font: 700 2rem var(--display);
}

.wardrobe-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: .9rem;
  padding: .35rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, .7);
}

.wardrobe-tabs button {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.wardrobe-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  box-shadow: 0 5px 14px rgba(124, 88, 173, .2);
}

.wardrobe-layout {
  display: grid;
  grid-template-columns: 265px 1fr;
  gap: 1rem;
  align-items: start;
}

.wardrobe-preview {
  position: sticky;
  top: 84px;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, .85);
  box-shadow: var(--small-shadow);
  text-align: center;
}

.wardrobe-preview > img,
.wardrobe-preview > .pet-render-slot {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 20px;
  object-fit: contain;
  background: linear-gradient(145deg, #fff8fb, #eef9f4);
}

.wardrobe-preview h3 {
  margin: .7rem 0;
}

.pet-edit-fields {
  display: grid;
  gap: .65rem;
  text-align: left;
}

.pet-edit-fields label,
.pet-select-label,
.adoption-fields label {
  display: grid;
  gap: .3rem;
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 800;
}

.pet-edit-fields input,
.pet-select-label select,
.adoption-fields input {
  width: 100%;
  min-height: 42px;
  padding: .5rem .65rem;
  border: 1px solid rgba(155, 117, 155, .22);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}

input[type="color"] {
  padding: .25rem;
  cursor: pointer;
}

.pet-select-label {
  margin-top: .75rem;
  text-align: left;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.shop-card {
  overflow: hidden;
  border: 1px solid rgba(236, 121, 172, .14);
  border-radius: 20px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--small-shadow);
}

.shop-card.selected {
  box-shadow: inset 0 0 0 3px var(--lavender), var(--small-shadow);
}

.shop-art {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  padding: .35rem;
  background: linear-gradient(145deg, #fff7fb, #eef9f5);
}

.shop-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shop-copy {
  display: grid;
  gap: .28rem;
  padding: .7rem;
}

.shop-copy strong {
  font-family: var(--display);
}

.shop-copy small {
  min-height: 1.1rem;
  color: var(--ink-soft);
}

.shop-copy button {
  min-height: 37px;
  margin-top: .25rem;
  border: 0;
  border-radius: 11px;
  color: var(--pink-dark);
  background: var(--pink-pale);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
}

.shop-card.selected .shop-copy button {
  color: #fff;
  background: var(--lavender);
}

.asset-paw {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 70px;
  place-items: center;
  color: var(--pink);
  font-size: 2rem;
  animation: paw-pulse 1.1s ease-in-out infinite;
}

.pet-render-slot {
  display: grid;
  place-items: center;
}

.pet-render-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.house-shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.house-card {
  overflow: hidden;
  border: 1px solid rgba(236, 121, 172, .14);
  border-radius: 24px;
  background: rgba(255, 255, 255, .87);
  box-shadow: var(--small-shadow);
}

.house-card.active {
  box-shadow: inset 0 0 0 4px var(--lavender), var(--shadow);
}

.house-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.house-card-body {
  display: grid;
  gap: .45rem;
  padding: .9rem;
}

.house-card h3,
.house-card p {
  margin: 0;
}

.house-card p {
  min-height: 2.7em;
  color: var(--ink-soft);
  font-size: .74rem;
  line-height: 1.4;
}

.house-price {
  color: #946613;
  font-weight: 800;
}

.game-dialog {
  position: relative;
  width: min(450px, calc(100% - 1.5rem));
  max-height: calc(100svh - 1.5rem);
  overflow: auto;
  padding: 1.4rem clamp(1.1rem, 4vw, 2rem) 1.7rem;
  border: 6px solid rgba(255, 255, 255, .9);
  border-radius: 30px;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, #fff 0 2px, transparent 3px),
    linear-gradient(160deg, #fffefd, #fde7f1);
  box-shadow: 0 30px 90px rgba(78, 44, 73, .35);
  text-align: center;
}

.game-dialog::backdrop {
  background: rgba(65, 44, 64, .5);
  backdrop-filter: blur(7px);
}

.game-dialog h2 {
  margin: .15rem 0 .55rem;
  color: var(--pink-dark);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
}

.game-dialog > p:not(.eyebrow) {
  color: var(--ink-soft);
  line-height: 1.52;
}

.travel-dialog {
  width: min(610px, calc(100% - 1.5rem));
}

.travel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin-top: 1rem;
}

.travel-stop {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: .55rem;
  min-height: 62px;
  padding: .55rem .7rem;
  border: 1px solid rgba(236, 121, 172, .17);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, .82);
  cursor: pointer;
  text-align: left;
}

.travel-stop:hover {
  color: var(--pink-dark);
  background: var(--pink-pale);
}

.travel-stop > span {
  font-size: 1.65rem;
  text-align: center;
}

.travel-stop b,
.travel-stop small {
  display: block;
}

.travel-stop b {
  font-family: var(--display);
}

.travel-stop small {
  margin-top: .12rem;
  color: var(--ink-soft);
  font-size: .62rem;
}

.dialog-sparkles {
  color: var(--gold);
  letter-spacing: .24em;
}

.dialog-pet-art {
  width: min(210px, 58vw);
  aspect-ratio: 1;
  margin: .25rem auto .55rem;
}

.dialog-actions {
  display: grid;
  gap: .55rem;
  margin-top: 1rem;
}

.dialog-close {
  position: absolute;
  top: .65rem;
  right: .65rem;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .8);
  cursor: pointer;
  font-size: 1.3rem;
}

.adoption-fields {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: .65rem;
  margin: 1rem 0;
  text-align: left;
}

.complete-dialog > img {
  width: 100px;
  height: 100px;
  margin: 0 auto .7rem;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: var(--small-shadow);
}

.toast {
  position: fixed;
  z-index: 100;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  max-width: min(480px, calc(100% - 1.5rem));
  padding: .72rem 1rem;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  color: #fff;
  background: rgba(73, 61, 78, .92);
  box-shadow: 0 10px 30px rgba(64, 44, 62, .25);
  font-size: .8rem;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity .2s ease, transform .2s ease;
  backdrop-filter: blur(10px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes float-sparkle {
  0%, 100% { opacity: .4; transform: translateY(0) rotate(0); }
  50% { opacity: 1; transform: translateY(-13px) rotate(30deg); }
}

@keyframes paw-pulse {
  0%, 100% { opacity: .65; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes hint-pulse {
  0%, 100% { opacity: .55; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes found-pop {
  from { opacity: 0; transform: scale(.75); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes miss-pop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.4) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(1.5) rotate(50deg); }
}

@keyframes pet-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

@media (max-width: 1050px) {
  .site-header {
    grid-template-columns: minmax(185px, 1fr) auto auto;
  }

  .header-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    margin: -.25rem 0 .15rem;
  }

  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .title-card {
    display: flex;
    flex-direction: column-reverse;
    min-height: auto;
    border-radius: 27px;
  }

  .title-visual {
    min-height: 330px;
    max-height: 44svh;
  }

  .title-copy {
    align-items: center;
    padding: 1.6rem 1.25rem 2rem;
    text-align: center;
  }

  .title-copy h1 {
    font-size: clamp(3rem, 14vw, 5rem);
  }

  .title-nova {
    width: 44%;
  }

  .title-intro {
    margin: 1rem 0;
  }

  .title-actions,
  .title-features {
    justify-content: center;
  }

  .world-heading,
  .page-heading {
    align-items: flex-start;
  }

  .wardrobe-layout {
    grid-template-columns: 220px 1fr;
  }

  .house-shop-grid {
    grid-template-columns: 1fr;
  }

  .family-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 680px) {
  .site-header {
    grid-template-columns: 1fr auto auto;
    min-height: 62px;
    padding: .35rem .55rem;
  }

  .brand-button img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand-button b {
    font-size: .82rem;
  }

  .brand-button small {
    font-size: .5rem;
  }

  .money-pill {
    min-width: 70px;
    padding: .4rem .55rem;
  }

  .round-button {
    width: 34px;
    height: 34px;
  }

  .header-nav {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: .15rem;
    scrollbar-width: none;
  }

  .header-nav::-webkit-scrollbar {
    display: none;
  }

  .header-nav button {
    flex: 0 0 auto;
  }

  main,
  .screen {
    min-height: calc(100svh - 104px);
  }

  .screen {
    padding: .65rem;
  }

  .world-heading {
    margin-bottom: .6rem;
  }

  .world-heading h2 {
    font-size: 2rem;
  }

  .world-heading > p {
    max-width: 17ch;
    text-align: right;
  }

  .desktop-help {
    display: none;
  }

  .touch-help {
    display: inline;
  }

  .world-frame {
    border-width: 4px;
    border-radius: 20px;
  }

  #town-canvas {
    height: calc(100svh - 225px);
    min-height: 440px;
  }

  .touch-controls {
    position: absolute;
    z-index: 9;
    right: .7rem;
    bottom: .7rem;
    left: .7rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    pointer-events: none;
  }

  .joystick,
  .interact-button {
    pointer-events: auto;
  }

  .joystick {
    position: relative;
    width: 116px;
    height: 116px;
    border: 3px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    background: rgba(73, 61, 78, .3);
    box-shadow: inset 0 0 0 1px rgba(73, 61, 78, .12);
    touch-action: none;
    backdrop-filter: blur(7px);
  }

  .joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 52px;
    height: 52px;
    border: 3px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    background: rgba(237, 118, 170, .88);
    box-shadow: 0 5px 15px rgba(69, 43, 68, .25);
    transform: translate(-50%, -50%);
  }

  .interact-button {
    width: 84px;
    height: 84px;
    border: 4px solid rgba(255, 255, 255, .88);
    border-radius: 50%;
    color: #fff;
    background: rgba(154, 127, 233, .92);
    box-shadow: 0 8px 24px rgba(69, 43, 68, .28);
    font-weight: 800;
  }

  .nearby-prompt {
    top: .55rem;
  }

  .nearby-prompt kbd {
    display: none;
  }

  .world-shortcuts {
    top: .45rem;
    left: .45rem;
    flex-direction: column;
    gap: .3rem;
  }

  .world-shortcuts button {
    width: 48px;
    min-height: 42px;
    justify-content: center;
    padding: .35rem;
    font-size: 0;
  }

  .world-shortcuts button span {
    font-size: 1rem;
  }

  .town-quick-actions {
    gap: .4rem;
  }

  .town-quick-actions button {
    min-height: 43px;
    font-size: .7rem;
  }

  .search-heading {
    grid-template-columns: auto 1fr auto;
  }

  .search-heading .eyebrow {
    display: none;
  }

  .search-heading h2 {
    font-size: 1.2rem;
  }

  .back-button,
  .hint-button {
    min-height: 36px;
    padding: .4rem .5rem;
    font-size: .65rem;
  }

  .search-scene {
    border-width: 4px;
    border-radius: 18px;
  }

  .page-heading {
    flex-direction: column;
    gap: .8rem;
  }

  .empty-house {
    grid-template-columns: 1fr;
  }

  .empty-house > img {
    min-height: 220px;
    max-height: 35svh;
  }

  .house-nova {
    width: 17%;
  }

  .wardrobe-layout {
    grid-template-columns: 1fr;
  }

  .wardrobe-preview {
    position: static;
  }

  .wardrobe-preview > img,
  .wardrobe-preview > .pet-render-slot {
    width: min(230px, 70vw);
    margin: 0 auto;
  }

  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .brand-button span {
    display: none;
  }

  .title-visual {
    min-height: 240px;
  }

  .title-nova {
    width: 50%;
  }

  .title-bubble {
    top: 5%;
    font-size: .72rem;
  }

  .title-features {
    display: none;
  }

  .button {
    min-height: 44px;
  }

  .town-quick-actions span {
    display: block;
    margin: 0 0 .1rem;
  }

  .family-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .shop-grid {
    gap: .45rem;
  }

  .shop-copy {
    padding: .55rem;
  }

  .shop-copy small {
    font-size: .58rem;
  }

  .adoption-fields {
    grid-template-columns: 1fr 84px;
  }

  .travel-grid {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) and (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
