:root {
  --ink: #241c16;
  --muted: #74685c;
  --paper: #f3ecdf;
  --card: #fffaf3;
  --line: #e6d8c4;
  --red: #c23a2e;
  --red-dark: #8e241c;
  --gold: #b8860b;
  --pine: #1f6b4a;
  --cbd: #1e4f86;
  --neon: #d63a78;
  --shadow: 0 18px 50px rgba(48, 28, 12, 0.16);
  --safe-b: env(safe-area-inset-bottom);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #d9c7a6; color: var(--ink); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { height: 100%; }

.top {
  position: fixed;
  z-index: 5;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 10px;
  align-items: stretch;
  pointer-events: none;
}
.brand, .stats, .hud {
  pointer-events: auto;
  background: rgba(255, 250, 243, 0.94);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.brand {
  border-radius: 18px;
  padding: 8px 14px 9px;
  min-width: 148px;
}
.help {
  pointer-events: auto;
  align-self: center;
  border: 0;
  background: var(--red);
  color: white;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  white-space: nowrap;
}
.hint {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: left;
  border: 0;
  background: #fff1e4;
  border-radius: 12px;
  padding: 8px 10px;
  line-height: 1.45;
}
.hint b { display: block; color: var(--red-dark); font-size: 12px; margin-bottom: 2px; }
.steps { display: grid; gap: 8px; margin: 10px 0 14px; }
.steps div { background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.steps b, .steps small { display: block; }
.steps small { color: var(--muted); margin-top: 2px; }
.brand b { display: block; font-size: 18px; letter-spacing: 0.08em; }
.brand span { color: var(--muted); font-size: 12px; }
.stats {
  margin-left: auto;
  border-radius: 18px;
  padding: 8px 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13px;
}
.stats strong { display: block; font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 99px; background: #2ea36a; display: inline-block; margin-right: 4px; }

.hud {
  position: fixed;
  z-index: 5;
  left: 12px;
  top: 78px;
  width: min(280px, calc(100% - 24px));
  border-radius: 18px;
  padding: 10px 12px 12px;
}
.who { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.who b { font-size: 16px; }
.cash { color: var(--red-dark); font-variant-numeric: tabular-nums; font-weight: 700; }
.meters { display: grid; gap: 5px; margin-top: 8px; }
.meter { display: grid; grid-template-columns: 32px 1fr 28px; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); }
.bar { height: 7px; background: #efe4d4; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.bar.hunger i { background: #d8892d; }
.bar.energy i { background: #2f8f62; }
.bar.mood i { background: #d63a78; }
.bar.face i { background: #1e4f86; }
.bar.social i { background: #7a5af8; }

#viewport {
  position: relative;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,248,230,.5), transparent 42%),
    linear-gradient(180deg, #efe2c6 0%, #e7d3ae 100%);
  cursor: grab;
}
#viewport.drag { cursor: grabbing; }
#world { position: absolute; width: 1400px; height: 980px; transform-origin: 0 0; }
#world svg { width: 100%; height: 100%; display: block; }
.ring { fill: none; stroke: rgba(194, 58, 46, 0.28); stroke-width: 8; }
.ring.inner { stroke: rgba(30, 79, 134, 0.25); }
.avenue { stroke: #c6a15a; stroke-width: 10; stroke-linecap: round; }
.district { font: 700 22px "PingFang SC", "Microsoft YaHei", sans-serif; fill: rgba(36, 28, 22, 0.28); }
.block { stroke: rgba(255,255,255,.45); stroke-width: 2; }
.pin {
  position: absolute;
  transform: translate(-50%, -110%);
  border: 0;
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 9px 5px 6px;
  box-shadow: 0 8px 18px rgba(48, 28, 12, 0.16);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}
.pin em { font-style: normal; font-size: 16px; }
.pin.here { outline: 3px solid var(--red); }
.pin.ad {
  background: #1b1a22;
  color: #ffe08a;
  border-radius: 8px;
  transform: translate(-50%, -120%);
}
.pin small { display: block; font-weight: 500; color: var(--muted); font-size: 10px; }
.pin.ad small { color: #f3b6cb; }

.dock {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: calc(12px + var(--safe-b));
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(255,250,243,.95);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.dock button {
  border: 0;
  background: transparent;
  border-radius: 14px;
  min-width: 72px;
  padding: 8px 10px 7px;
}
.dock button.on, .dock button:hover { background: #f6e2cf; }
.dock strong { display: block; font-size: 13px; }
.dock span { color: var(--muted); font-size: 11px; }

.zoom {
  position: fixed;
  z-index: 6;
  right: 12px;
  bottom: calc(84px + var(--safe-b));
  display: grid;
  gap: 6px;
}
.zoom button, .ghost, .primary, .choice, .mini button, .sheet header button {
  border: 0;
  border-radius: 12px;
}
.zoom button {
  width: 42px;
  height: 42px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 20px;
}

#overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: none;
  background: rgba(36, 22, 12, 0.28);
}
#overlay.show { display: block; }
.pick {
  max-height: 28vh;
  overflow: auto;
  display: grid;
  gap: 6px;
}
.pick button {
  text-align: left;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 8px 10px;
}
.pick b, .pick small { display: block; }
.sheet, .full {
  background: var(--card);
  box-shadow: var(--shadow);
}
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: min(86vh, 760px);
  overflow: auto;
  border-radius: 24px 24px 0 0;
  padding: 8px 16px calc(18px + var(--safe-b));
}
.sheet header, .full header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sheet h2, .full h2 { margin: 8px 0 0; font-size: 24px; }
.kicker { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.blurb { line-height: 1.55; }
.close {
  margin-top: 8px;
  background: #f3e7d8;
  padding: 8px 12px;
}
.actions, .grid, .apps { display: grid; gap: 8px; }
.choice, .app, .job, .lead button, .primary {
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.choice b, .app b, .job b { display: block; }
.choice small, .app small, .job small, .ghost small, .mini small, label small, .moment-actions small, .pick small, .muted { color: var(--muted); }
.choice small, .app small, .job small, .primary small, .ghost small, .mini small, label small, .moment-actions small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}
.primary small { color: rgba(255, 255, 255, 0.9); }
a.contact { color: var(--red-dark); font-weight: 700; }
.choice:disabled { opacity: 0.45; }
.primary, .lead button.primary {
  width: 100%;
  background: var(--red);
  color: #fff;
  border: 0;
  text-align: center;
  font-weight: 700;
}
.ghost { background: transparent; color: var(--red-dark); padding: 10px; }

.full {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 22px 18px 40px;
  background:
    radial-gradient(circle at 80% 0%, #f6d7c6, transparent 36%),
    var(--paper);
}
.cards { display: grid; gap: 8px; }
.cards button, .origin {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.76);
  border-radius: 16px;
  padding: 12px;
}
.origin.on { border-color: var(--red); background: #fff4ea; }
.origin b, .origin small { display: block; }
.origin small { margin-top: 3px; }
label { display: grid; gap: 6px; margin: 14px 0; color: var(--muted); font-size: 13px; }
label input, .lead textarea { width: 100%; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 12px; }
.name-row { display: flex; gap: 8px; }
.name-row input, .lead input, .lead textarea, .chat-row input {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 12px;
}
.phone {
  width: min(390px, 100%);
  margin: 0 auto;
  background: #16141a;
  color: #f7f1e8;
  border-radius: 28px;
  padding: 18px 14px 16px;
  min-height: 70vh;
}
.phone h2 { color: white; }
.apps { grid-template-columns: 1fr 1fr; }
.app { background: #26232c; color: #f7f1e8; border: 0; min-height: 84px; }
.screen { background: #fffaf3; color: var(--ink); border-radius: 18px; padding: 12px; }
.chat { display: grid; gap: 6px; max-height: 280px; overflow: auto; }
.chat p { margin: 0; background: white; border-radius: 12px; padding: 8px 10px; }
.chat-row { display: flex; gap: 6px; margin-top: 8px; }
.log p { margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }

.mini {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #141820;
  color: white;
}
.mini .panel { width: min(420px, 100%); text-align: center; }
.doors {
  margin: 18px 0;
  height: 140px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  background: #3a4254;
}
.doors.open { background: #2f8f62; }
.mini button { background: white; color: #141820; padding: 12px 18px; font-weight: 800; }

.share {
  width: min(420px, calc(100% - 32px));
  margin: 12vh auto;
  background: #1b1a22;
  color: #fff8ea;
  border-radius: 24px;
  padding: 22px;
}
.share em { color: #f0c36a; font-style: normal; }
.toast {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: calc(92px + var(--safe-b));
  transform: translateX(-50%) translateY(12px);
  background: #241c16;
  color: white;
  padding: 12px 14px;
  border-radius: 14px;
  max-width: min(440px, calc(100% - 24px));
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.ticker {
  position: fixed;
  z-index: 4;
  left: 50%;
  top: 78px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 28px));
  background: rgba(27, 26, 34, 0.88);
  color: #fff6df;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roast { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--red-dark); }
.pressure { margin: 4px 0 0; font-size: 13px; font-weight: 700; }
.dock button.hot span { color: var(--red-dark); font-weight: 700; }
.pin.me { background: var(--red); color: white; z-index: 3; }
#people { position: absolute; inset: 0; }
.citizen {
  position: absolute;
  transform: translate(-50%, -50%);
  background: white;
  border: 0;
  border-radius: 999px;
  padding: 3px 8px 3px 5px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(48, 28, 12, 0.18);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
}
.citizen.real { color: #2046b0; }
.citizen .who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.citizen .who small { font-size: 10px; font-weight: 600; max-width: 108px; }
.citizen i {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #2f8f62;
  display: block;
}
.pin.ad {
  display: grid;
  border-radius: 12px;
  padding: 7px 10px;
  background: #17161c;
  color: #ffe7a3;
  min-width: 132px;
}
.pin.ad b { font-size: 13px; }
.pin.ad small { color: #ff8fb5; }
.pin.out {
  background: #1d4f91;
  color: white;
  border: 2px solid #f0c36a;
  z-index: 2;
}
.choice.outbound {
  display: block;
  background: #1d4f91;
  color: white;
  text-decoration: none;
}
.choice.outbound small { color: #d6e4f7; }
.shop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.shop-row b {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.3;
}
.shop-btn {
  flex: none;
  background: #1d4f91;
  color: white;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}
.shop-btn:disabled { opacity: 0.55; cursor: wait; }
.shop-btn.missing { background: #efe6d6; color: #241c16; }
.citizen.due i { box-shadow: 0 0 0 3px #f0c36a; }
.miniroom.stage {
  height: 340px;
  margin: 8px 0 12px;
  border-radius: 18px;
  overflow: hidden;
  perspective: 900px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 250, 243, 0.95), transparent 58%),
    linear-gradient(180deg, #f6efe2 0%, #e7d3ae 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
  position: relative;
}
.room3d {
  width: 230px;
  height: 190px;
  margin: 118px auto 0;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(48deg) rotateZ(-26deg);
}
.room3d .floor,
.room3d .rug,
.room3d .wall,
.room3d .sofa,
.room3d .table,
.room3d .plant,
.room3d .poster,
.room3d .shelf,
.room3d .lamp,
.room3d .curtain {
  position: absolute;
  transform-style: preserve-3d;
}
.room3d .floor {
  inset: 0;
  background: var(--floor);
  box-shadow: inset 0 0 0 10px rgba(80, 60, 30, 0.18);
}
.room3d .rug {
  left: 36px;
  top: 48px;
  width: 120px;
  height: 78px;
  border-radius: 28px;
  background: var(--rug);
  transform: translateZ(2px);
  box-shadow: 0 8px 14px rgba(48, 28, 12, 0.12);
}
.room3d .wall.back {
  left: 0;
  right: 0;
  height: 150px;
  bottom: 100%;
  background: linear-gradient(#f4efe6, var(--wall));
  transform-origin: bottom center;
  transform: rotateX(-90deg);
  box-shadow: inset 0 -20px 0 rgba(0, 0, 0, 0.06);
}
.room3d .wall.side {
  top: 0;
  bottom: 0;
  width: 150px;
  left: 100%;
  background: color-mix(in srgb, var(--wall) 72%, #6d5840);
  transform-origin: left center;
  transform: rotateY(90deg);
}
.city-window {
  position: absolute;
  left: 16px;
  top: 18px;
  width: 70px;
  height: 54px;
  background: linear-gradient(#fffaf3, #f0d7b0);
  border: 6px solid #fffaf3;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(48, 28, 12, 0.12);
  color: var(--red-dark);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: flex-end;
  padding: 4px;
}
.room3d .poster {
  left: 108px;
  top: 28px;
  width: 52px;
  height: 64px;
  background: #fffaf3;
  border: 3px solid #e6d8c4;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(48, 28, 12, 0.12);
  color: var(--red);
  font-size: 26px;
}
.room3d .shelf {
  left: 104px;
  top: 104px;
  width: 78px;
  height: 16px;
  background: #8a5a32;
  font-size: 16px;
}
.room3d .shelf i {
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
  background: #a56b3d;
}
.room3d .sofa {
  left: 18px;
  top: 28px;
  width: 86px;
  height: 36px;
  background: var(--sofa);
  border: 0;
  border-radius: 16px 16px 12px 12px;
  box-shadow: 0 10px 16px rgba(48, 28, 12, 0.16);
  transform: translateZ(16px);
}
.room3d .sofa i {
  position: absolute;
  left: 0;
  right: 0;
  top: -22px;
  height: 22px;
  border-radius: 14px 14px 4px 4px;
  background: color-mix(in srgb, var(--sofa) 82%, white);
}
.room3d .table {
  left: 118px;
  top: 78px;
  width: 54px;
  height: 36px;
  background: var(--table);
  border-radius: 12px;
  box-shadow: 0 8px 14px rgba(48, 28, 12, 0.14);
  transform: translateZ(14px);
}
.room3d .table i {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 8px;
  bottom: -16px;
  background: color-mix(in srgb, var(--table) 70%, black);
}
.room3d .plant {
  right: 16px;
  bottom: 16px;
  width: 36px;
  height: 36px;
  font-size: 28px;
  background: transparent;
  transform: translateZ(12px);
}
.room3d .rug.look-round { width: 92px; height: 92px; left: 50px; top: 40px; border-radius: 50%; }
.room3d .rug.look-check { background: repeating-conic-gradient(var(--rug) 0 25%, #f7f1e4 0 50%); }
.room3d .rug.look-none { background: transparent; box-shadow: inset 0 0 0 2px rgba(80, 60, 30, 0.28); }
.room3d .sofa.look-cushion { width: 52px; height: 28px; border-radius: 18px; }
.room3d .sofa.look-cushion i { display: none; }
.room3d .table.look-desk { width: 72px; height: 26px; }
.room3d .table.look-tea { width: 42px; height: 42px; border-radius: 50%; }
.room3d .table.look-none, .room3d .table.look-none i { visibility: hidden; }
.room3d .poster.look-blank { color: transparent; }
.room3d .lamp {
  left: 10px;
  bottom: 18px;
  width: 6px;
  height: 42px;
  background: #cbb892;
  transform: translateZ(18px);
}
.room3d .lamp::before {
  content: "";
  position: absolute;
  left: -10px;
  top: -14px;
  width: 26px;
  height: 16px;
  background: #fffaf3;
  border-radius: 14px 14px 8px 8px;
  box-shadow: 0 0 16px #f0c36a;
}
.room3d .lamp.look-off { display: none; }
.room3d .lamp.look-neon::before { background: #b9a0ff; box-shadow: 0 0 14px #7d5cff; }
.room3d .curtain {
  left: 16px;
  top: 18px;
  width: 70px;
  height: 54px;
  z-index: 2;
  background: transparent;
}
.room3d .curtain.look-linen { background: linear-gradient(90deg, transparent 0 30%, rgba(247, 244, 238, 0.88) 70%); }
.room3d .curtain.look-stripe { background: repeating-linear-gradient(90deg, rgba(196, 71, 60, 0.55) 0 8px, transparent 8px 16px); }
.room3d .curtain.look-night { background: rgba(20, 28, 44, 0.72); }
.miniroom.glow-warm { box-shadow: inset 0 0 48px rgba(255, 214, 140, 0.45); }
.miniroom.glow-neon { box-shadow: inset 0 0 48px rgba(140, 110, 255, 0.4); }
.room-dress {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 6px;
  align-items: start;
}
.room-dress .dress-col { max-height: 320px; }
.room-dress .miniroom.stage { height: 300px; margin: 0; }
.room-dress .room3d { margin-top: 84px; }
#room-line { margin: 6px 0 0; font-size: 12px; font-weight: 700; }
.dress-btn.locked { opacity: 0.5; }
.dress-btn b { min-height: 16px; border-radius: 6px; }
.miniroom:not(.mine) .piece { pointer-events: none; }
.room3d button { border: 0; font: inherit; background: transparent; }
.form-error { min-height: 1.2em; color: #9d1c1c; font-weight: 700; }
.person .stage { height: 250px; }
.person .room3d { margin-top: 72px; }
.person .pet-view { height: 190px; }
.city-screen {
  position: fixed;
  z-index: 5;
  right: 18px;
  top: 88px;
  width: min(340px, calc(100% - 32px));
  max-height: min(52vh, 520px);
  overflow: auto;
  background: #1b1a22;
  color: #fff8ea;
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.city-screen header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.city-screen header b { display: block; }
.city-screen header small, .city-screen .kicker { color: #f0c36a; }
.hud .fold, .city-screen .fold {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  padding: 8px 12px;
  box-shadow: 0 6px 16px rgba(48, 28, 12, 0.18);
}
.hud .fold {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  background: var(--red);
  color: white;
}
.city-screen .fold {
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  width: 100%;
  margin: 0 0 8px;
  background: #fff8ea;
  color: #1b1a22;
}
.hud.folded, .city-screen.folded {
  width: 52px;
  max-height: 148px;
  padding: 8px 6px;
  overflow: hidden;
}
.hud.folded #hud-body, .city-screen.folded .screen-body { display: none; }
.room-sheet { background: rgba(255, 250, 243, 0.96); }
.room-sheet .fold {
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: white;
  font-weight: 800;
  padding: 8px 12px;
  margin-top: 8px;
}
#overlay.room-tucked { background: transparent; pointer-events: none; }
#overlay.room-tucked .room-sheet {
  pointer-events: auto;
  left: 12px;
  right: auto;
  top: 248px;
  bottom: auto;
  width: 52px;
  max-height: 148px;
  overflow: hidden;
  border-radius: 18px;
  padding: 8px 6px;
}
#overlay.room-tucked .room-sheet > :not(header) { display: none; }
#overlay.room-tucked .room-sheet header > :not(.fold) { display: none; }
#overlay.room-tucked .room-sheet header { margin: 0; }
#overlay.room-tucked .room-sheet .fold {
  width: 40px;
  height: 128px;
  margin: 0;
  padding: 10px 0;
  writing-mode: vertical-rl;
  letter-spacing: 0.08em;
}
.hud.folded .fold, .city-screen.folded .fold {
  width: 40px;
  height: 128px;
  margin: 0;
  padding: 10px 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.08em;
}
.city-screen header button, .city-screen .screen-acts button, .city-screen .empty {
  border: 0;
  border-radius: 999px;
  background: #f0c36a;
  color: #1b1a22;
  font-weight: 800;
  padding: 6px 10px;
}
.city-screen article { padding: 8px 0; border-top: 1px solid rgba(255, 248, 234, 0.12); }
.city-screen article a { color: inherit; text-decoration: none; display: block; }
.city-screen article b { display: block; line-height: 1.35; }
.city-screen article small { color: #d9c7a4; }
.screen-acts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.screen-acts button { background: #2c3548; color: #fff8ea; }
#screen-ads { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.screen-slot {
  display: block;
  min-height: 52px;
  border-radius: 12px;
  background: #2a241c;
  color: #fff8ea;
  text-decoration: none;
  padding: 8px;
  text-align: left;
}
.screen-slot b, .screen-slot small { display: block; }
.screen-slot small { color: #f0c36a; }
.screen-slot.empty { width: 100%; background: #141820; color: #fff8ea; border-radius: 12px; }
@media (max-width: 900px) {
  .city-screen { top: auto; bottom: calc(84px + var(--safe-b)); max-height: 34vh; }
}
.back, .back-row .back {
  background: #efe6d6;
  color: #241c16;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
}
.pet-follow {
  position: absolute;
  left: -18px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  overflow: hidden;
  pointer-events: none;
}
.pet-follow .pet3d.tiny {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160px;
  height: 120px;
  margin-left: -80px;
  margin-top: -64px;
  transform: scale(0.16);
}
.pet-follow.sad { filter: grayscale(1); opacity: 0.75; }
.pet-list { max-height: 52vh; overflow: auto; }
.pet-pick { display: flex; gap: 8px; align-items: center; text-align: left; }
.pet-dress {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 68px;
  gap: 6px;
  align-items: stretch;
}
.dress-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}
.dress-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.dress-btn {
  border: 1px solid #e6d8c4;
  background: rgba(255, 250, 243, 0.96);
  color: #241c16;
  border-radius: 16px;
  padding: 4px 0 3px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 14px rgba(48, 28, 12, 0.08);
}
.dress-btn b { display: block; font-size: 16px; line-height: 1.1; border-radius: 10px; }
.dress-btn small { display: block; font-size: 9px; color: var(--muted); }
.dress-btn.owned { border-color: var(--red); }
.dress-btn.worn { background: var(--red); color: white; border-color: var(--red); }
.dress-btn.worn small { color: rgba(255, 255, 255, 0.86); }
.pet-hold { min-width: 0; }
.pet-view {
  position: relative;
  height: 250px;
  margin: 8px 0 12px;
  border-radius: 18px;
  perspective: 800px;
  background: radial-gradient(circle at 50% 78%, #f6efe2 0%, #d5e3ef 62%, #b9cfe2 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pet-dress .pet-view { height: 230px; margin: 0; }
#pet-wear-line { margin: 6px 0 0; font-size: 12px; font-weight: 700; }
.pet-view .pet3d { position: relative; z-index: 2; }
.pet-view .prop { position: absolute; z-index: 1; pointer-events: none; }
.prop.rug { left: 16%; right: 16%; bottom: 22px; height: 26px; border-radius: 50%; background: #c45c4a; }
.prop.grass { left: 8%; right: 8%; bottom: 16px; height: 36px; border-radius: 50%; background: #7dae62; }
.prop.tile { left: 0; right: 0; bottom: 0; height: 48px; background: repeating-linear-gradient(90deg, #e7d3b0 0 18px, #f4e6cf 18px 36px); }
.prop.bed { left: 8%; bottom: 28px; width: 72px; height: 34px; background: #f7f1e6; border: 3px solid #d7c4a3; border-radius: 12px 12px 8px 8px; }
.prop.bed::before { content: ""; position: absolute; left: 6px; top: 6px; width: 20px; height: 14px; background: #f4c7c7; border-radius: 6px; }
.prop.basket { left: 8%; bottom: 30px; width: 64px; height: 26px; border: 4px solid #a56b3c; border-bottom: 0; border-radius: 8px 8px 18px 18px; background: #f0d2a8; }
.prop.blanket { left: 10%; bottom: 34px; width: 76px; height: 18px; background: #6f8fbf; border-radius: 8px; transform: rotate(-8deg); }
.prop.ball { right: 12%; bottom: 40px; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff 0 3px, #e23b3b 4px 9px, #f4f1ea 10px 12px, #1d4f91 13px); }
.prop.yarn { right: 14%; bottom: 38px; width: 22px; height: 22px; border-radius: 50%; background: repeating-radial-gradient(circle, #e7b08a 0 3px, #c47a4a 3px 5px); }
.prop.mouse { right: 14%; bottom: 42px; width: 28px; height: 14px; background: #8a8a8a; border-radius: 10px; }
.prop.mouse::after { content: ""; position: absolute; right: -12px; top: 5px; width: 14px; height: 2px; background: #666; border-radius: 2px; }
.prop.bowl { left: 6%; bottom: 36px; width: 34px; height: 14px; background: #f7f3ea; border: 3px solid #c9bba8; border-radius: 0 0 16px 16px; }
.prop.bowl::before { content: ""; position: absolute; left: 8px; top: 2px; width: 14px; height: 6px; background: #c47a3a; border-radius: 6px; }
.prop.lamp { right: 12%; bottom: 48px; width: 6px; height: 46px; background: #cbb892; }
.prop.lamp::before { content: ""; position: absolute; left: -12px; top: -16px; width: 30px; height: 16px; background: #ffe7a3; border-radius: 8px 8px 4px 4px; box-shadow: 0 0 16px #ffe7a3; }
.prop.plant { right: 10%; bottom: 36px; width: 16px; height: 12px; background: #c47a3a; border-radius: 0 0 6px 6px; }
.prop.plant::before { content: ""; position: absolute; left: -10px; top: -20px; width: 36px; height: 22px; background: #3f8f4e; border-radius: 18px; }
.prop.moon { right: 14%; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: #f4e7b0; box-shadow: 8px -6px 0 -6px #24324d; }
.pet-view.has-moon { background: radial-gradient(circle at 78% 22%, #f4e7b0 0 10px, transparent 12px), linear-gradient(180deg, #24324d 0%, #3c4d6e 70%, #1c2433 100%); }
.pet-view.has-lamp { box-shadow: inset 0 0 36px rgba(255, 214, 120, 0.55); }
.pet-view.has-grass { background: linear-gradient(180deg, #d5e7f4 0 58%, #8fbf73 58% 100%); }
.pet3d { transform-style: preserve-3d; width: 160px; height: 120px; }
.pet3d .spin {
  position: relative;
  width: 160px;
  height: 120px;
  transform-style: preserve-3d;
  animation: pet-sway 3.2s ease-in-out infinite alternate;
}
@keyframes pet-sway { to { transform: rotateY(28deg) rotateX(8deg); } }
.pet3d .body, .pet3d .head, .pet3d .leg, .pet3d .tail, .pet3d .wing, .pet3d .ear, .pet3d .bowl, .pet3d .cape {
  position: absolute;
  transform-style: preserve-3d;
}
.pet3d .shadow {
  position: absolute;
  left: 28px;
  top: 92px;
  width: 100px;
  height: 18px;
  background: rgba(40, 30, 20, 0.22);
  border-radius: 50%;
  transform: rotateX(70deg);
}
.pet3d .body {
  left: 34px;
  top: 42px;
  width: 92px;
  height: 46px;
  background: linear-gradient(180deg, var(--belly), var(--body));
  border-radius: 40px 48px 36px 42px;
  transform: translateZ(12px);
}
.pet3d .belly {
  position: absolute;
  left: 18px;
  top: 16px;
  width: 48px;
  height: 22px;
  background: var(--belly);
  border-radius: 20px;
  opacity: 0.9;
}
.pet3d .head {
  left: 96px;
  top: 28px;
  width: 48px;
  height: 44px;
  background: var(--body);
  border-radius: 22px;
  transform: translateZ(26px);
}
.pet3d .ear {
  position: absolute;
  top: -14px;
  width: 16px;
  height: 22px;
  background: var(--ink);
  border-radius: 10px 10px 4px 4px;
}
.pet3d .ear.left { left: 4px; }
.pet3d .ear.right { right: 4px; }
.pet3d .eye {
  position: absolute;
  top: 14px;
  width: 8px;
  height: 8px;
  background: #1b1a22;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
}
.pet3d .eye.left { left: 8px; }
.pet3d .eye.right { right: 8px; }
.pet3d .muzzle {
  position: absolute;
  left: 14px;
  top: 26px;
  width: 20px;
  height: 12px;
  background: var(--belly);
  border-radius: 10px;
}
.pet3d .muzzle::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 6px;
  height: 5px;
  background: var(--ink);
  border-radius: 50%;
}
.pet3d .leg {
  width: 12px;
  height: 28px;
  background: var(--ink);
  border-radius: 6px;
  top: 74px;
}
.pet3d .l1 { left: 46px; transform: translateZ(18px); }
.pet3d .l2 { left: 68px; transform: translateZ(18px); }
.pet3d .l3 { left: 52px; transform: translateZ(-4px); }
.pet3d .l4 { left: 86px; transform: translateZ(-4px); }
.pet3d .tail {
  left: 12px;
  top: 48px;
  width: 28px;
  height: 12px;
  background: var(--body);
  border-radius: 10px;
  transform: translateZ(4px) rotate(-18deg);
}
.pet3d .wing { display: none; }
.pet3d .hat {
  position: absolute;
  left: 6px;
  top: -18px;
  width: 36px;
  height: 16px;
  background: #2b3a55;
  border-radius: 8px 8px 2px 2px;
}
.pet3d .hat::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 12px;
  width: 48px;
  height: 6px;
  background: #1d283c;
  border-radius: 4px;
}
.pet3d .collar {
  position: absolute;
  left: 92px;
  top: 58px;
  width: 22px;
  height: 8px;
  background: #9d1c1c;
  border-radius: 6px;
  transform: translateZ(20px);
}
.pet3d .bell {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 8px;
  height: 8px;
  background: #e0b15a;
  border-radius: 50%;
}
.pet3d .scarf {
  position: absolute;
  left: 88px;
  top: 62px;
  width: 34px;
  height: 12px;
  background: #c4473c;
  transform: translateZ(22px) rotate(12deg);
}
.pet3d .cape {
  left: 28px;
  top: 36px;
  width: 70px;
  height: 54px;
  background: #7d2d4a;
  border-radius: 8px 20px 16px 16px;
  transform: translateZ(-8px);
}
.pet3d .sweater {
  left: 40px;
  top: 46px;
  width: 78px;
  height: 36px;
  background: #3d6ea8;
  border-radius: 16px 18px 12px 12px;
  transform: translateZ(16px);
}
.pet3d .pack {
  left: 18px;
  top: 40px;
  width: 22px;
  height: 28px;
  background: #c47a3a;
  border-radius: 6px 6px 4px 4px;
  transform: translateZ(-6px);
}
.pet3d .pack::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -6px;
  width: 14px;
  height: 8px;
  border: 2px solid #8a4e1d;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.pet3d .crown {
  position: absolute;
  left: 8px;
  top: -16px;
  width: 32px;
  height: 14px;
  background: linear-gradient(180deg, #f0c36a, #c47a3a);
  clip-path: polygon(0 100%, 0 40%, 20% 70%, 35% 10%, 50% 70%, 65% 10%, 80% 70%, 100% 40%, 100% 100%);
}
.pet3d .bow {
  position: absolute;
  left: -4px;
  top: 2px;
  width: 16px;
  height: 10px;
  background: #c4476a;
  border-radius: 8px 2px 2px 8px;
}
.pet3d .bow::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 0;
  width: 16px;
  height: 10px;
  background: #c4476a;
  border-radius: 2px 8px 8px 2px;
}
.pet3d .shades {
  position: absolute;
  left: 4px;
  top: 16px;
  width: 40px;
  height: 10px;
  background: #1b1a22;
  border-radius: 4px;
  transform: translateZ(8px);
}
.pet3d .phones {
  position: absolute;
  left: -2px;
  top: 8px;
  width: 52px;
  height: 8px;
  background: #2b3a55;
  border-radius: 4px;
}
.pet3d .phones::before, .pet3d .phones::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 12px;
  height: 18px;
  background: #1d283c;
  border-radius: 6px;
}
.pet3d .phones::before { left: -2px; }
.pet3d .phones::after { right: -2px; }
.pet3d .flower {
  position: absolute;
  right: -6px;
  top: 8px;
  width: 12px;
  height: 12px;
  background: #e07a9a;
  border-radius: 50%;
  box-shadow: -6px 0 0 #f4c7c7, 6px 0 0 #f4c7c7, 0 -6px 0 #f4c7c7, 0 6px 0 #f4c7c7;
}
.pet3d .collar.bare { background: transparent; }
.pet3d .bandana {
  position: absolute;
  left: 2px;
  top: 4px;
  width: 18px;
  height: 12px;
  background: #e07a3a;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.pet3d .tie {
  position: absolute;
  left: 4px;
  top: 6px;
  width: 14px;
  height: 8px;
  background: #6b4c9a;
  border-radius: 6px;
}
.pet3d .tie::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 6px;
  height: 8px;
  background: #6b4c9a;
}
.pet3d.kind-cat .ear { height: 26px; clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; background: var(--body); }
.pet3d.kind-cat .tail { height: 8px; width: 36px; top: 36px; }
.pet3d.kind-bird .leg { width: 4px; height: 18px; }
.pet3d.kind-bird .l3, .pet3d.kind-bird .l4 { display: none; }
.pet3d.kind-bird .wing { display: block; width: 28px; height: 16px; background: var(--ink); top: 50px; border-radius: 0 16px 16px 0; }
.pet3d.kind-bird .wing.left { left: 40px; transform: translateZ(20px) rotate(-12deg); }
.pet3d.kind-bird .wing.right { left: 70px; transform: translateZ(-6px); }
.pet3d.kind-bird .muzzle { width: 14px; height: 8px; left: 30px; background: #e0b15a; border-radius: 0 8px 8px 0; }
.pet3d.kind-fish .leg, .pet3d.kind-fish .ear, .pet3d.kind-fish .tail { display: none; }
.pet3d.kind-fish .body { border-radius: 50% 46% 46% 50%; left: 48px; }
.pet3d.kind-fish .body::after {
  content: "";
  position: absolute;
  left: -16px;
  top: 10px;
  border-left: 18px solid var(--body);
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}
.pet3d.kind-fish .bowl {
  left: 24px;
  top: 18px;
  width: 112px;
  height: 84px;
  border: 6px solid rgba(120, 170, 200, 0.55);
  border-radius: 0 0 56px 56px;
  background: rgba(170, 210, 230, 0.28);
  transform: translateZ(8px);
}
.pet3d.kind-small .body { width: 70px; height: 52px; left: 48px; border-radius: 40px; }
.pet3d.kind-small .ear { height: 28px; }
.pet3d.kind-reptile .body { height: 28px; top: 56px; border-radius: 16px; }
.pet3d.kind-reptile .head { width: 36px; height: 28px; top: 46px; }
.pet3d.snake .leg { display: none; }
.pet3d.snake .body { width: 120px; height: 18px; left: 20px; top: 62px; border-radius: 20px; }
.pet3d.stage-0 { transform: scale(0.62); }
.pet3d.stage-1 { transform: scale(0.78); }
.pet3d.stage-2 { transform: scale(0.94); }
.pet3d.stage-3 { transform: scale(1.08); }
.pet3d.stage-1 .body,
.pet3d.stage-2 .body {
  background-image: repeating-linear-gradient(100deg, transparent 0 7px, rgba(255,255,255,.25) 7px 8px), linear-gradient(180deg, var(--belly), var(--body));
}
.pet3d.stage-2 .muzzle::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 3px;
  width: 8px;
  height: 6px;
  background: #2a211c;
  border-radius: 50%;
}
.pet3d.stage-2 .head::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 24px;
  width: 16px;
  height: 1px;
  background: var(--ink);
  box-shadow: 0 4px 0 var(--ink), 42px 0 0 var(--ink), 42px 4px 0 var(--ink);
}
.real-pet {
  width: min(100%, 210px);
  height: 190px;
  object-fit: cover;
  border-radius: 18px;
  position: relative;
  z-index: 3;
}
.pet-follow .real-pet.tiny {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
}
.pet3d.tiny { transform: scale(0.42); width: 78px; height: 58px; }
.pet3d.frozen { filter: grayscale(0.85); }
.citizen { overflow: visible; }
#viewport[data-sky="night"] {
  background:
    radial-gradient(circle at 50% 40%, rgba(70, 86, 140, .35), transparent 46%),
    linear-gradient(180deg, #24324d 0%, #1a2233 100%);
}
#moment {
  position: fixed;
  z-index: 7;
  left: 16px;
  bottom: calc(92px + var(--safe-b));
  width: min(360px, calc(100% - 32px));
  display: none;
}
#moment.on { display: block; }
#moment .kicker, #moment h2, #moment p, #moment strong { display: block; }
#moment {
  background: #1b1a22;
  color: #fff8ea;
  border-radius: 22px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
#moment h2 { margin: 4px 0 8px; font-size: 26px; }
#moment p { margin: 0 0 8px; line-height: 1.5; color: #f3e6cf; }
#moment strong { color: #f0c36a; font-size: 18px; }
#moment .kicker { color: #f0c36a; }
.moment-actions { display: flex; gap: 8px; margin-top: 12px; }
.moment-actions button {
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  background: white;
  color: #1b1a22;
  font-weight: 700;
}
#overlay.show { background: rgba(36, 22, 12, 0.12); }
#overlay.show.room-tucked { background: transparent; }
.create-sheet { max-height: min(70vh, 640px); }

@media (min-width: 900px) {
  .sheet {
    left: auto;
    top: 88px;
    right: 18px;
    bottom: 18px;
    width: 420px;
    border-radius: 24px;
    max-height: none;
  }
  .hud { top: 86px; }
}
@media (max-width: 720px) {
  .stats span.label { display: none; }
  .hud { top: auto; bottom: calc(78px + var(--safe-b)); width: calc(100% - 24px); }
  .top { top: 8px; }
}
