/* =========================================================
   Furiend 绒友 · 我的小屋
   选择宠物 / 我的认领
   ========================================================= */

.is-hidden {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

.app-page {
  min-height: 100svh;
  padding-bottom: 0;
}

.app-topbar {
  padding-bottom: 7px;
}

.app-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

.app-user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px dashed rgba(181, 135, 102, .5);
  border-radius: 999px;
  background: rgba(255, 251, 243, .5);
  transition: background .2s, border-color .2s, transform .2s;
}

.app-user-chip:hover {
  border-color: rgba(170, 116, 80, .75);
  background: rgba(255, 251, 243, .85);
  transform: translateY(-1px);
}

.app-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #fffaf2;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #f9e0cc, #eeb59c);
  color: #775746;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 9px -5px rgba(123, 79, 49, .35);
}

.app-greeting {
  display: flex;
  align-items: baseline;
  gap: 1px;
  color: #6d5140;
  font-family: var(--hand);
}

.app-greeting small {
  color: #a58b78;
  font-size: 11px;
}

.app-greeting b {
  font-size: 13px;
  font-weight: 700;
}

.app-exit {
  color: #a58b78;
  font-family: var(--hand);
  font-size: 12px;
  letter-spacing: .04em;
  border-bottom: 1px dashed rgba(174, 132, 100, .5);
  transition: color .2s, border-color .2s;
}

.app-exit:hover {
  color: #b56b4c;
  border-color: #b56b4c;
}

.app-main {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 1310px;
  margin: 0 auto;
  padding: 26px 54px 125px;
}

.app-view {
  animation: app-view-in .45s var(--ease) both;
}

@keyframes app-view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-heading .eyebrow,
.pets-heading .eyebrow {
  justify-content: flex-start;
}

.app-heading h1,
.pets-heading h1 {
  margin-top: 11px;
  color: #473226;
  font-family: var(--serif);
  font-size: clamp(34px, 3.55vw, 49px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.27;
  text-wrap: balance;
}

.title-break {
  display: none;
}

.app-lede {
  max-width: 730px;
  margin-top: 9px;
  color: #8c725f;
  font-family: var(--hand);
  font-size: 15px;
  letter-spacing: .025em;
  line-height: 1.75;
}

/* ---------- choose ---------- */
.choose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  align-items: start;
  gap: 26px;
  margin-top: 22px;
}

.pet-picker {
  min-width: 0;
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 5px;
}

.picker-head h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #5d4536;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.picker-head h2 span {
  color: #b19782;
  font-family: var(--hand);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .02em;
}

.picker-arrows {
  display: flex;
  gap: 6px;
}

.picker-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px dashed rgba(185, 139, 105, .55);
  border-radius: 50%;
  background: rgba(255, 251, 243, .45);
  color: #ab8469;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}

.picker-arrow svg {
  width: 15px;
  height: 15px;
}

#scrollBack svg {
  transform: rotate(180deg);
}

.picker-arrow:hover {
  border-color: rgba(168, 110, 73, .8);
  background: rgba(255, 251, 243, .9);
  color: #b36c4a;
  transform: translateY(-1px);
}

.pet-scroller {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 10px 4px 15px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pet-scroller::-webkit-scrollbar {
  display: none;
}

.pet-choice {
  position: relative;
  display: flex;
  flex: 0 0 calc((100% - 56px) / 5);
  flex-direction: column;
  min-width: 138px;
  max-width: 190px;
  height: 262px;
  padding: 8px;
  overflow: hidden;
  border: 1.5px solid transparent;
  border-radius: 23px 26px 22px 25px;
  background: var(--card-bg, #f8e7d7);
  color: inherit;
  text-align: center;
  scroll-snap-align: start;
  box-shadow: 0 10px 20px -20px rgba(129, 82, 52, .35);
  transition: transform .28s var(--ease), border-color .25s, box-shadow .28s;
}

.pet-choice::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .2;
  mix-blend-mode: multiply;
  background-image: url("../assets/paper.svg");
  background-size: 280px 280px;
  border-radius: inherit;
}

.pet-choice:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 27px -22px rgba(124, 78, 48, .5);
}

.pet-choice.is-selected {
  z-index: 2;
  border-color: rgba(209, 132, 91, .9);
  transform: translateY(-9px);
  box-shadow:
    0 22px 31px -23px rgba(128, 78, 47, .58),
    0 0 0 4px rgba(255, 250, 241, .7);
}

.choice-art {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 17px 20px 16px 19px;
  background: rgba(255, 251, 244, .54);
}

.choice-art img {
  width: 88%;
  height: 90%;
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(1.03) contrast(1.02) drop-shadow(0 8px 8px rgba(140, 87, 52, .09));
}

.choice-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 2px 5px;
}

.choice-copy b {
  color: #5b4131;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.choice-copy small {
  color: #9b7d66;
  font-family: var(--hand);
  font-size: 10.5px;
  letter-spacing: .02em;
}

.choice-heart {
  position: absolute;
  top: 11px;
  right: 12px;
  z-index: 2;
  width: 15px;
  height: 15px;
  color: #d99374;
  opacity: .55;
}

.choice-check {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 3;
  display: none;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1.5px solid rgba(255, 250, 243, .8);
  border-radius: 50%;
  background: #d9865f;
  color: #fff9f0;
  box-shadow: 0 3px 8px -4px rgba(135, 80, 47, .5);
}

.choice-check svg {
  width: 13px;
  height: 13px;
}

.pet-choice.is-selected .choice-check {
  display: grid;
}

.choice-badge {
  position: absolute;
  bottom: 55px;
  left: 11px;
  z-index: 2;
  padding: 3px 6px;
  border: 1px solid rgba(158, 116, 84, .25);
  border-radius: 999px;
  background: rgba(255, 251, 244, .76);
  color: #a3785e;
  font-family: var(--hand);
  font-size: 9px;
  line-height: 1.2;
}

.picker-hint {
  padding: 0 5px;
  color: #b19884;
  font-family: var(--hand);
  font-size: 10.5px;
  letter-spacing: .035em;
}

.picker-hint span {
  margin: 0 4px;
  color: #d1a98f;
}

/* ---------- detail panel ---------- */
.pet-detail {
  position: sticky;
  top: 20px;
  padding: 22px 22px 20px;
  border: 1px solid rgba(203, 161, 125, .52);
  border-radius: 28px 32px 26px 30px;
  background:
    linear-gradient(180deg, rgba(255, 252, 245, .94), rgba(255, 249, 239, .9));
  box-shadow: var(--shadow-paper);
  isolation: isolate;
}

.pet-detail::after {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: -1;
  border: 1px dashed rgba(206, 169, 135, .25);
  border-radius: 22px 26px 20px 24px;
  pointer-events: none;
}

.detail-eyebrow {
  color: #a1846e;
  font-family: var(--hand);
  font-size: 13px;
  letter-spacing: .08em;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 11px;
}

.detail-portrait {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 3px solid #fffaf2;
  border-radius: 27px 29px 25px 28px;
  background: var(--detail-bg, #f7e2d2);
  box-shadow: 0 8px 16px -10px rgba(132, 79, 46, .3);
}

.detail-portrait img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(1.04) contrast(1.02);
}

.detail-heart {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 14px;
  height: 14px;
  color: #fff9ef;
  filter: drop-shadow(0 1px 2px rgba(159, 99, 62, .28));
}

.detail-title {
  min-width: 0;
}

.detail-title h2 {
  color: #513a2c;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.25;
}

.detail-title p {
  margin-top: 3px;
  color: #9c806b;
  font-family: var(--hand);
  font-size: 12px;
  letter-spacing: .02em;
}

.detail-copy {
  min-height: 47px;
  margin-top: 13px;
  color: #816653;
  font-family: var(--hand);
  font-size: 13.5px;
  line-height: 1.75;
}

.detail-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px dashed rgba(213, 184, 157, .55);
  list-style: none;
}

.detail-points li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.point-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: rgba(247, 231, 215, .86);
  color: #ba7956;
}

.point-icon svg {
  width: 14px;
  height: 14px;
}

.detail-points span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.detail-points b {
  color: #684f3f;
  font-family: var(--hand);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
}

.detail-points small {
  color: #a58a76;
  font-family: var(--hand);
  font-size: 10.5px;
}

.detail-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  color: #ab8e78;
  font-family: var(--hand);
  font-size: 10.5px;
  letter-spacing: .01em;
}

.detail-note span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e2b296;
}

.choose-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-top: 12px;
  border: 1px solid rgba(174, 93, 54, .3);
  border-radius: 999px;
  background:
    radial-gradient(ellipse 70% 160% at 9% -20%, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, #e6a077 0%, #df9167 60%, #d9875e 100%);
  color: #fff9ef;
  font-family: var(--hand);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .055em;
  box-shadow: 0 10px 20px -14px rgba(165, 89, 50, .7);
  transition: transform .2s var(--ease), filter .2s;
}

.choose-cta svg {
  width: 15px;
  height: 15px;
}

.choose-cta:hover {
  filter: saturate(1.04);
  transform: translateY(-1px);
}

/* ---------- my pets ---------- */
.pets-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-top: 5px;
}

.pets-heading h1 {
  font-size: clamp(38px, 4.3vw, 55px);
}

.readopt-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  border: 1px dashed rgba(183, 132, 97, .62);
  border-radius: 999px;
  background: rgba(255, 251, 243, .48);
  color: #9a7259;
  font-family: var(--hand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  transition: background .2s, border-color .2s, transform .2s;
}

.readopt-btn svg {
  width: 15px;
  height: 15px;
  color: #c27a55;
}

.readopt-btn:hover {
  border-color: rgba(168, 110, 73, .85);
  background: rgba(255, 251, 243, .9);
  transform: translateY(-1px);
}

.current-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-top: 15px;
  padding: 7px 13px 7px 8px;
  border: 1px dashed rgba(196, 154, 119, .48);
  border-radius: 999px;
  background: rgba(255, 251, 243, .45);
  color: #90745f;
  font-family: var(--hand);
  font-size: 12px;
  letter-spacing: .015em;
}

.current-paw {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f6dfcd;
  color: #bf7a55;
}

.current-paw svg {
  width: 14px;
  height: 14px;
}

.current-strip b {
  color: #604636;
  font-weight: 700;
}

.current-note {
  color: #b0917a;
  font-size: 10.5px;
}

.current-line {
  flex: 1;
  height: 1px;
  margin: 0 4px;
  background: linear-gradient(90deg, rgba(215, 185, 159, .5), rgba(215, 185, 159, 0));
}

.current-day {
  color: #b59a84;
  font-size: 10.5px;
  white-space: nowrap;
}

.pets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.claimed-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 326px;
  padding: 15px 13px 13px;
  border: 1.5px solid rgba(214, 184, 157, .55);
  border-radius: 23px 26px 22px 25px;
  background:
    linear-gradient(180deg, rgba(255, 252, 245, .9), rgba(255, 249, 239, .92));
  cursor: pointer;
  text-align: left;
  box-shadow: 0 12px 24px -26px rgba(128, 79, 47, .4);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}

.claimed-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .17;
  mix-blend-mode: multiply;
  background-image: url("../assets/paper.svg");
  background-size: 300px 300px;
  border-radius: inherit;
}

.claimed-card:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 128, 91, .72);
  box-shadow: 0 18px 28px -26px rgba(128, 79, 47, .5);
}

.claimed-card.is-current {
  border-color: rgba(210, 139, 99, .9);
  background:
    linear-gradient(180deg, rgba(255, 249, 239, .98), rgba(255, 245, 232, .96));
  box-shadow:
    0 18px 28px -26px rgba(128, 79, 47, .55),
    0 0 0 4px rgba(255, 249, 239, .7);
}

.claimed-card:focus-visible {
  outline: 2px solid var(--orange-deep);
  outline-offset: 3px;
}

.claimed-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: transparent;
}

.claimed-hit:focus-visible {
  outline: 2px solid var(--orange-deep);
  outline-offset: 4px;
}

.claimed-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  pointer-events: none;
}

.claimed-content .name-link {
  pointer-events: auto;
}

.claimed-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.partner {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #6e5342;
  font-family: var(--hand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.partner-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid #fffaf2;
  border-radius: 50%;
  color: #765645;
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 3px 7px -5px rgba(117, 74, 47, .4);
}

.active-badge {
  flex: none;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f2d3bd;
  color: #a55e3d;
  font-family: var(--hand);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
}

.claimed-art {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  min-height: 125px;
  margin-top: 7px;
  place-items: center;
  overflow: hidden;
  border-radius: 16px 19px 15px 18px;
  background: var(--card-bg, #f6e1ce);
}

.claimed-art::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 14px;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(198, 144, 108, .35);
  border-radius: 50%;
  background: rgba(255, 251, 244, .45);
  box-shadow: 7px 5px 0 -4px rgba(221, 165, 126, .45);
}

.claimed-art img {
  width: 86%;
  height: 91%;
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(1.04) contrast(1.02) drop-shadow(0 8px 8px rgba(140, 87, 52, .09));
}

.claimed-info {
  position: relative;
  z-index: 1;
  padding-top: 10px;
}

.claimed-name {
  overflow: hidden;
  color: #563e2f;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.claimed-name small {
  margin-left: 5px;
  color: #a78b75;
  font-family: var(--hand);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .02em;
}

.claimed-name.is-unnamed {
  color: #806452;
}

.name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 19px;
  margin-top: 1px;
  color: #ae927d;
  font-family: var(--hand);
  font-size: 10.5px;
}

.name-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border: 1px solid rgba(182, 111, 76, .35);
  border-radius: 999px;
  background: rgba(255, 251, 243, .55);
  color: #b16b4c;
  font-family: var(--hand);
  font-size: 10px;
  font-weight: 700;
  transition: color .2s, border-color .2s, background .2s;
}

.name-link:hover {
  color: #955335;
  border-color: rgba(149, 83, 53, .7);
  background: rgba(255, 251, 243, .9);
}

.name-link svg {
  width: 10px;
  height: 10px;
}

.affinity {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  color: #a18672;
  font-family: var(--hand);
  font-size: 11px;
}

.affinity svg {
  width: 12px;
  height: 12px;
  color: #db9b7e;
}

.affinity b {
  color: #b76f4e;
  font-family: "Trebuchet MS", var(--sans);
  font-size: 13px;
  font-weight: 700;
}

.pets-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  margin-top: 20px;
  padding: 30px;
  border: 1px dashed rgba(197, 156, 121, .55);
  border-radius: 28px;
  background: rgba(255, 251, 244, .4);
  text-align: center;
}

.empty-paw {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #f6dfcd;
  color: #c37e58;
}

.empty-paw svg {
  width: 29px;
  height: 29px;
}

.pets-empty h2 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  color: #594130;
}

.pets-empty p {
  margin-top: 6px;
  color: #957a66;
  font-family: var(--hand);
  font-size: 13px;
}

.empty-cta {
  width: auto;
  min-width: 190px;
  margin-top: 17px;
  padding: 0 22px;
}

/* ---------- bottom dock ---------- */
.app-dock {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 60;
  display: flex;
  width: min(560px, calc(100vw - 30px));
  padding: 6px;
  border: 1px solid rgba(214, 181, 152, .75);
  border-radius: 999px;
  background: rgba(255, 251, 243, .9);
  box-shadow: 0 14px 32px -18px rgba(121, 76, 46, .35);
  backdrop-filter: blur(15px);
  transform: translateX(-50%);
}

.dock-item {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  border-radius: 999px;
  color: #a18772;
  font-family: var(--hand);
  font-size: 12px;
  letter-spacing: .02em;
  transition: background .2s, color .2s;
}

.dock-icon {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
}

.dock-icon svg {
  width: 17px;
  height: 17px;
}

.dock-item:hover {
  background: rgba(247, 232, 216, .5);
  color: #806452;
}

.dock-item.is-active {
  background: #f3dac6;
  color: #8e5a40;
  font-weight: 700;
}

/* ---------- naming modal ---------- */
.name-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(73, 52, 39, .28);
  backdrop-filter: blur(7px);
  animation: modal-fade .22s var(--ease) both;
}

.name-backdrop[hidden] {
  display: none;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.name-modal {
  position: relative;
  width: min(390px, 100%);
  padding: 27px 26px 22px;
  border: 1px solid rgba(198, 153, 117, .55);
  border-radius: 30px 34px 28px 32px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, .98), rgba(255, 248, 237, .98));
  box-shadow: 0 30px 70px -30px rgba(91, 57, 37, .55);
  text-align: center;
  transform: rotate(-.3deg);
  animation: modal-in .3s var(--ease) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) rotate(-.3deg) scale(.98); }
  to { opacity: 1; transform: translateY(0) rotate(-.3deg) scale(1); }
}

.name-modal::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: -1;
  border: 1px dashed rgba(207, 169, 135, .26);
  border-radius: 24px 28px 22px 26px;
  pointer-events: none;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #a58a76;
  transition: background .2s, color .2s;
}

.modal-close:hover {
  background: rgba(243, 225, 208, .6);
  color: #765845;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-pet {
  width: 104px;
  height: 104px;
  margin: 0 auto 13px;
  overflow: hidden;
  border: 3px solid #fffaf2;
  border-radius: 50%;
  background: var(--modal-bg, #f6e1cf);
  box-shadow: 0 10px 19px -13px rgba(131, 81, 49, .45);
}

.modal-pet img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.name-modal .login-kicker {
  justify-content: center;
}

.name-modal h2 {
  margin-top: 8px;
  color: #4e382b;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.modal-copy {
  margin-top: 6px;
  color: #967b67;
  font-family: var(--hand);
  font-size: 12.5px;
  line-height: 1.7;
}

.modal-label {
  display: block;
  margin: 15px 2px 6px;
  color: #795c4a;
  font-family: var(--hand);
  font-size: 12.5px;
  text-align: left;
}

.modal-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.2px solid #e0cbb7;
  border-radius: 13px 15px 12px 14px;
  outline: none;
  background: rgba(255, 251, 243, .78);
  color: #533c2e;
  font-family: var(--hand);
  font-size: 15px;
  letter-spacing: .04em;
  text-align: center;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.modal-input::placeholder {
  color: #b9a28e;
}

.modal-input:focus {
  border-color: #dc9874;
  background: #fffdf8;
  box-shadow: 0 0 0 4px rgba(220, 152, 116, .1);
}

.modal-error {
  min-height: 15px;
  margin-top: 4px;
  color: #bd6752;
  font-family: var(--hand);
  font-size: 10.5px;
  text-align: left;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.18fr;
  gap: 8px;
  margin-top: 4px;
}

.modal-secondary,
.modal-primary {
  height: 43px;
  border-radius: 999px;
  font-family: var(--hand);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .035em;
  transition: background .2s, border-color .2s, transform .2s;
}

.modal-secondary {
  border: 1px dashed rgba(184, 137, 105, .55);
  background: rgba(255, 252, 246, .35);
  color: #987963;
}

.modal-secondary:hover {
  border-color: rgba(165, 112, 77, .8);
  background: rgba(255, 252, 246, .8);
}

.modal-primary {
  border: 1px solid rgba(174, 93, 54, .3);
  background: #de9269;
  color: #fff9ef;
  box-shadow: 0 8px 15px -10px rgba(158, 84, 47, .6);
}

.modal-primary:hover {
  background: #d9875e;
  transform: translateY(-1px);
}

.modal-hint {
  margin-top: 10px;
  color: #b29a87;
  font-family: var(--hand);
  font-size: 9.5px;
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .app-main {
    padding-right: 38px;
    padding-left: 38px;
  }

  .choose-layout {
    grid-template-columns: minmax(0, 1fr) 286px;
    gap: 21px;
  }

  .pet-choice {
    flex-basis: calc((100% - 42px) / 4);
  }

  .pets-grid {
    gap: 13px;
  }

  .claimed-card {
    padding-right: 11px;
    padding-left: 11px;
  }

  .claimed-name {
    font-size: 19px;
  }
}

@media (max-width: 940px) {
  .app-main {
    max-width: 600px;
    padding: 24px 26px 120px;
  }

  .choose-layout {
    display: block;
    margin-top: 18px;
  }

  .pet-choice {
    flex-basis: calc((100% - 42px) / 4);
    height: 246px;
  }

  .pet-detail {
    position: relative;
    top: auto;
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    column-gap: 18px;
    margin-top: 14px;
    padding: 21px;
  }

  .detail-eyebrow {
    grid-column: 1 / -1;
  }

  .detail-head {
    grid-column: 1;
    grid-row: 2 / span 2;
    display: block;
    margin-top: 10px;
  }

  .detail-portrait {
    width: 100px;
    height: 100px;
  }

  .detail-title {
    margin-top: 9px;
    text-align: center;
  }

  .detail-title h2 {
    font-size: 24px;
  }

  .detail-title p {
    font-size: 10.5px;
  }

  .detail-copy {
    grid-column: 2;
    margin-top: 10px;
    min-height: 0;
  }

  .detail-points {
    grid-column: 2;
    margin-top: 8px;
    padding-top: 9px;
    gap: 6px;
  }

  .detail-points li:nth-child(3) {
    display: none;
  }

  .detail-note {
    grid-column: 1 / -1;
    margin-top: 11px;
  }

  .choose-cta {
    grid-column: 1 / -1;
    margin-top: 8px;
  }

  .pets-heading {
    align-items: center;
  }

  .pets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .claimed-card {
    min-height: 302px;
  }

  .app-dock {
    bottom: 12px;
  }
}

@media (max-width: 620px) {
  .app-topbar {
    padding-top: 17px;
  }

  .app-page .brand-word {
    font-size: 31px;
  }

  .app-page .brand-cn {
    display: none;
  }

  .app-user {
    gap: 7px;
  }

  .app-user-chip {
    gap: 6px;
    padding: 4px 8px 4px 4px;
  }

  .app-greeting small {
    display: none;
  }

  .app-greeting b {
    font-size: 11.5px;
  }

  .app-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  .app-exit {
    font-size: 10.5px;
  }

  .app-main {
    padding: 19px 17px 110px;
  }

  .app-heading h1 {
    font-size: clamp(29px, 7.8vw, 36px);
    line-height: 1.32;
  }

  .app-lede {
    font-size: 12px;
    line-height: 1.65;
  }

  .picker-head h2 {
    font-size: 17px;
  }

  .pet-scroller {
    gap: 10px;
    padding-top: 7px;
  }

  .pet-choice {
    flex-basis: 143px;
    min-width: 143px;
    height: 226px;
    border-radius: 20px 22px 19px 21px;
  }

  .choice-copy b {
    font-size: 15px;
  }

  .choice-copy small {
    font-size: 9.5px;
  }

  .pet-detail {
    display: block;
    padding: 19px 18px 18px;
  }

  .detail-head {
    display: flex;
    align-items: center;
  }

  .detail-title {
    margin-top: 0;
    text-align: left;
  }

  .detail-portrait {
    width: 86px;
    height: 86px;
  }

  .detail-copy {
    margin-top: 12px;
  }

  .detail-points {
    display: none;
  }

  .title-break {
    display: block;
  }

  .choose-view .choose-cta {
    position: fixed;
    right: 17px;
    bottom: 77px;
    left: 17px;
    z-index: 70;
    width: auto;
    margin: 0;
    box-shadow:
      0 16px 28px -16px rgba(145, 77, 42, .65),
      0 0 0 5px rgba(251, 243, 229, .7);
  }

  .choose-view {
    padding-bottom: 66px;
  }

  .pets-heading {
    display: block;
  }

  .pets-heading h1 {
    font-size: 38px;
  }

  .readopt-btn {
    height: 38px;
    margin-top: 12px;
    font-size: 12px;
  }

  .current-strip {
    margin-top: 12px;
    font-size: 11px;
  }

  .current-note,
  .current-line {
    display: none;
  }

  .current-day {
    margin-left: auto;
    font-size: 10px;
  }

  .pets-grid {
    gap: 10px;
    margin-top: 17px;
  }

  .claimed-card {
    min-height: 270px;
    padding: 11px 9px 10px;
    border-radius: 19px 21px 18px 20px;
  }

  .partner {
    gap: 5px;
    font-size: 10.5px;
  }

  .partner-avatar {
    width: 23px;
    height: 23px;
    font-size: 9px;
  }

  .active-badge {
    display: none;
  }

  .claimed-art {
    min-height: 105px;
    margin-top: 6px;
  }

  .claimed-name {
    font-size: 18px;
  }

  .claimed-name small {
    display: block;
    margin-left: 0;
    font-size: 9.5px;
  }

  .name-line {
    font-size: 9.5px;
  }

  .name-link {
    font-size: 9.5px;
  }

  .affinity {
    font-size: 10px;
  }

  .affinity b {
    font-size: 12px;
  }

  .app-dock {
    width: calc(100vw - 24px);
    bottom: 9px;
    padding: 5px;
  }

  .dock-item {
    gap: 3px;
    height: 45px;
    font-size: 10.5px;
  }

  .dock-icon {
    width: 16px;
    height: 16px;
  }

  .dock-icon svg {
    width: 15px;
    height: 15px;
  }

  .name-modal {
    padding: 25px 20px 20px;
  }

  .name-modal h2 {
    font-size: 25px;
  }

  .modal-pet {
    width: 92px;
    height: 92px;
  }
}

@media (max-height: 800px) and (min-width: 941px) {
  .app-main {
    padding-top: 15px;
  }

  .choose-layout {
    margin-top: 16px;
  }

  .pet-choice {
    height: 238px;
  }

  .pet-detail {
    padding-top: 19px;
    padding-bottom: 17px;
  }

  .detail-points {
    gap: 6px;
  }

  .pets-grid {
    margin-top: 16px;
  }

  .claimed-card {
    min-height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-view,
  .name-backdrop,
  .name-modal {
    animation: none;
  }
}

/* =========================================================
   局域网账号 · 小屋设置
   ========================================================= */
.invite-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 33px;
  padding: 0 10px;
  border: 1px dashed rgba(190, 144, 109, .55);
  border-radius: 999px;
  background: rgba(255, 251, 243, .5);
  color: #987762;
  font-family: var(--hand);
  font-size: 10.5px;
  transition: background .2s, border-color .2s;
}

.invite-chip b {
  color: #b56b4b;
  font-family: "Trebuchet MS", var(--sans);
  font-size: 11px;
  letter-spacing: .08em;
}

.invite-chip:hover {
  border-color: rgba(169, 111, 75, .82);
  background: rgba(255, 251, 243, .9);
}

.setup-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100svh - 240px);
  padding: 18px 0 20px;
}

.setup-paper {
  position: relative;
  width: min(550px, 100%);
  padding: 38px 38px 30px;
  border: 1px solid rgba(199, 155, 118, .52);
  border-radius: 30px 35px 28px 33px;
  background: linear-gradient(180deg, rgba(255, 252, 245, .96), rgba(255, 249, 239, .94));
  box-shadow: var(--shadow-paper);
  transform: rotate(-.25deg);
}

.setup-paper::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: -1;
  border: 1px dashed rgba(205, 166, 133, .27);
  border-radius: 23px 28px 21px 26px;
  pointer-events: none;
}

.setup-paper h1 {
  margin-top: 12px;
  color: #4a3428;
  font-family: var(--serif);
  font-size: clamp(34px, 3.6vw, 44px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.26;
}

.setup-form {
  margin-top: 21px;
}

.setup-form label {
  display: block;
  margin-bottom: 7px;
  color: #7b5f4b;
  font-family: var(--hand);
  font-size: 13px;
  letter-spacing: .04em;
}

.setup-input-row {
  display: flex;
  gap: 8px;
}

.setup-input-row input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1.2px solid #e0cbb7;
  border-radius: 12px 15px 12px 14px;
  outline: none;
  background: rgba(255, 251, 243, .7);
  color: #503b2e;
  font-family: var(--sans);
  font-size: 13px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.setup-input-row input:focus {
  border-color: #dc9874;
  background: #fffdf8;
  box-shadow: 0 0 0 4px rgba(220, 152, 116, .1);
}

.setup-input-row input::placeholder {
  color: #b9a28f;
}

.setup-input-row button {
  flex: none;
  height: 48px;
  padding: 0 17px;
  border: 1px solid rgba(174, 93, 54, .3);
  border-radius: 999px;
  background: linear-gradient(180deg, #e6a077 0%, #df9167 60%, #d9875e 100%);
  color: #fff9ef;
  font-family: var(--hand);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  box-shadow: 0 9px 18px -13px rgba(165, 89, 50, .7);
  transition: transform .2s, filter .2s;
}

.setup-input-row button:hover {
  filter: saturate(1.04);
  transform: translateY(-1px);
}

.setup-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 16px;
  color: #b69b87;
  font-family: var(--hand);
  font-size: 11px;
}

.setup-or::before,
.setup-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(219, 194, 171, .1), rgba(219, 194, 171, .75), rgba(219, 194, 171, .1));
}

.setup-error {
  min-height: 16px;
  margin-top: 10px;
  color: #bd6652;
  font-family: var(--hand);
  font-size: 11.5px;
}

.setup-hint {
  margin-top: 5px;
  color: #b09885;
  font-family: var(--hand);
  font-size: 10px;
  line-height: 1.6;
}

/* =========================================================
   宠物主页
   ========================================================= */
.home-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 3px;
}

.home-heading h1 {
  margin-top: 8px;
  color: #473226;
  font-family: var(--serif);
  font-size: clamp(38px, 4.3vw, 55px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.18;
}

.home-pet-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: #9b7f6b;
  font-family: var(--hand);
  font-size: 12px;
  letter-spacing: .02em;
}

.meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #dfb296;
}

.home-rename {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 5px;
  padding: 1px 7px;
  border: 1px dashed rgba(182, 135, 100, .45);
  border-radius: 999px;
  color: #a87c61;
  font-family: var(--hand);
  font-size: 10px;
  transition: background .2s, border-color .2s;
}

.home-rename svg {
  width: 9px;
  height: 9px;
}

.home-rename:hover {
  border-color: rgba(168, 110, 73, .8);
  background: rgba(255, 251, 243, .8);
}

.home-state-pill {
  display: flex;
  flex: none;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(202, 161, 126, .55);
  border-radius: 999px;
  background: rgba(255, 251, 243, .58);
  color: #846653;
  font-family: var(--hand);
  font-size: 12px;
  letter-spacing: .02em;
  transform: rotate(-.6deg);
  transition: background .25s, color .25s, border-color .25s;
}

.state-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a1b88e;
  box-shadow: 0 0 0 3px rgba(161, 184, 142, .14);
  transition: background .25s, box-shadow .25s;
}

.home-state-pill[data-state="hungry"] {
  border-color: rgba(214, 159, 111, .55);
  background: rgba(250, 234, 215, .7);
  color: #986039;
}

.home-state-pill[data-state="hungry"] .state-dot {
  background: #d99561;
  box-shadow: 0 0 0 3px rgba(217, 149, 97, .14);
}

.home-state-pill[data-state="thirsty"] {
  border-color: rgba(149, 180, 187, .5);
  background: rgba(230, 240, 239, .65);
  color: #63828a;
}

.home-state-pill[data-state="thirsty"] .state-dot {
  background: #8eafb8;
  box-shadow: 0 0 0 3px rgba(142, 175, 184, .14);
}

.home-state-pill[data-state="sleepy"],
.home-state-pill[data-state="sleeping"] {
  border-color: rgba(182, 169, 143, .5);
  background: rgba(242, 237, 225, .68);
  color: #8d7e65;
}

.home-state-pill[data-state="sleepy"] .state-dot,
.home-state-pill[data-state="sleeping"] .state-dot {
  background: #a99a7e;
  box-shadow: 0 0 0 3px rgba(169, 154, 126, .14);
}

.home-state-pill[data-state="playful"] {
  border-color: rgba(219, 156, 143, .5);
  background: rgba(250, 231, 226, .7);
  color: #a86656;
}

.home-state-pill[data-state="playful"] .state-dot {
  background: #da9888;
  box-shadow: 0 0 0 3px rgba(218, 152, 136, .14);
}

.pet-room {
  position: relative;
  height: clamp(455px, 60vh, 575px);
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid rgba(198, 154, 119, .45);
  border-radius: 32px 38px 30px 35px;
  background:
    radial-gradient(ellipse at 55% 19%, rgba(255, 251, 243, .85) 0%, rgba(255, 251, 243, 0) 56%),
    linear-gradient(180deg, #fcf4e7 0%, #f8ead9 100%);
  box-shadow:
    0 20px 46px -32px rgba(131, 82, 50, .35),
    inset 0 1px 0 rgba(255, 255, 255, .75);
  isolation: isolate;
}

.pet-room::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: multiply;
  background-image: url("../assets/paper.svg");
  background-size: 480px 480px;
}

.room-wall {
  position: absolute;
  inset: 0 0 43%;
  background:
    radial-gradient(ellipse at 18% 16%, rgba(246, 204, 184, .4), rgba(246, 204, 184, 0) 56%),
    linear-gradient(180deg, #fdf7ed, #fbf1e3);
}

.room-floor {
  position: absolute;
  right: -2%;
  bottom: -2%;
  left: -2%;
  height: 52%;
  border-radius: 48% 52% 0 0 / 12% 14% 0 0;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255, 242, 228, .8) 0%, rgba(255, 242, 228, 0) 55%),
    linear-gradient(180deg, #f4d5bf 0%, #f6dfcd 54%, #f8e7d6 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}

.room-wash {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.wash-a {
  top: -24%;
  left: -12%;
  width: 48%;
  height: 64%;
  background: radial-gradient(ellipse at 50% 50%, rgba(241, 189, 164, .35), rgba(241, 189, 164, 0) 70%);
  transform: rotate(14deg);
}

.wash-b {
  right: -10%;
  bottom: -24%;
  width: 50%;
  height: 60%;
  background: radial-gradient(ellipse at 50% 50%, rgba(239, 186, 157, .3), rgba(239, 186, 157, 0) 70%);
  transform: rotate(-13deg);
}

.room-bed {
  position: absolute;
  bottom: 25%;
  left: 6%;
  z-index: auto;
  width: 270px;
  height: 188px;
  border-radius: 50%;
  background: transparent;
  transition: filter .35s;
}

.bed-art,
.bed-front-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.bed-art {
  z-index: 2;
  filter: drop-shadow(0 14px 13px rgba(137, 83, 50, .14));
}

.bed-front-art {
  z-index: 6;
  opacity: 0;
  clip-path: inset(51% 0 0 0);
  filter: drop-shadow(0 6px 5px rgba(137, 83, 50, .1));
  transition: opacity .35s;
}

.pet-room.is-sleeping .bed-front-art {
  opacity: 0;
}

.room-bed:hover .bed-art {
  filter:
    drop-shadow(0 14px 13px rgba(137, 83, 50, .14))
    drop-shadow(0 0 12px rgba(241, 195, 154, .28));
}

.bed-back,
.bed-inner,
.bed-front {
  position: absolute;
  border-radius: 50%;
}

.bed-back {
  inset: 0;
  background:
    radial-gradient(ellipse at 48% 35%, #f9e8d7 0%, #f4d9c2 45%, #e6bca0 100%);
  box-shadow:
    0 20px 27px -22px rgba(139, 86, 52, .5),
    inset 0 8px 14px rgba(255, 255, 255, .45),
    inset 0 -7px 14px rgba(178, 117, 78, .12);
}

.bed-inner {
  top: 24%;
  right: 14%;
  bottom: 22%;
  left: 14%;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 45%, #bd8765 0%, #d59f7d 43%, #efc9ad 100%);
  box-shadow:
    inset 0 11px 18px rgba(122, 74, 43, .24),
    inset 0 -4px 7px rgba(255, 240, 222, .2);
}

.bed-front {
  right: 2%;
  bottom: -3%;
  left: 2%;
  z-index: 3;
  height: 52%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, #f7e3d0, #ebc5a9 68%, #dfae8e 100%);
  box-shadow:
    0 8px 13px -10px rgba(137, 82, 49, .3),
    inset 0 5px 9px rgba(255, 255, 255, .3);
}

.bed-moon {
  position: absolute;
  top: 31%;
  left: 47%;
  z-index: 1;
  color: #f8dfae;
  font-family: var(--serif);
  font-size: 28px;
  opacity: .85;
}

.bed-label {
  position: absolute;
  right: 0;
  bottom: -30px;
  left: 0;
  z-index: 7;
  color: #987b65;
  font-family: var(--hand);
  font-size: 14px;
  letter-spacing: .08em;
  text-align: center;
  white-space: nowrap;
}

.pet-room.is-over-bed .room-bed {
  filter: drop-shadow(0 0 20px rgba(244, 191, 147, .85));
  transform: scale(1.035);
}

.pet-stage {
  position: absolute;
  bottom: 8%;
  left: 50%;
  z-index: 4;
  width: clamp(250px, 26vw, 330px);
  height: clamp(310px, 37vh, 430px);
  transform: translateX(-50%);
  transition:
    left .45s var(--ease),
    bottom .45s var(--ease),
    width .45s var(--ease),
    height .45s var(--ease),
    transform .45s var(--ease);
  touch-action: none;
  cursor: grab;
}

.pet-stage:active {
  cursor: grabbing;
}

.pet-stage img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter:
    saturate(1.04)
    contrast(1.02)
    drop-shadow(0 13px 12px rgba(135, 82, 49, .15));
  pointer-events: none;
  transition: transform .55s var(--ease), filter .45s;
  -webkit-user-drag: none;
}

.pet-stage video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 26px;
  outline: none;
  background: transparent;
  object-fit: cover;
  object-position: center 44%;
  opacity: 0 !important;
  pointer-events: none;
  transform: scale(1.025);
  transition: opacity .55s ease, transform .7s var(--ease);
  filter: saturate(1.06) contrast(1.04);
}

.pet-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  pointer-events: none;
  filter: saturate(1.04) contrast(1.02);
  transition: opacity .3s ease;
}

.pet-stage.is-video .pet-canvas {
  opacity: 1;
}

.pet-stage.is-video.is-soft-video video {
  opacity: 1 !important;
  transform: scale(.82) !important;
  clip-path: inset(0 0 8% 0);
}

.pet-stage.is-video.is-hungry-video video {
  opacity: 0 !important;
}

.pet-stage.is-video.is-hungry-video .pet-canvas {
  opacity: 1;
}

.pet-stage.is-video.is-doze-video video {
  opacity: 0 !important;
}

.pet-stage.is-video.is-doze-video .pet-canvas {
  opacity: 1;
}

.pet-stage.is-video video {
  opacity: 1;
  transform: scale(1);
}

.pet-stage.is-video img {
  display: none;
  opacity: 0;
  transition: none;
  transform: scale(.985);
}

.pet-stage.is-eating[data-species="dog"] video {
  -webkit-mask-image: radial-gradient(ellipse 82% 88% at 50% 45%, #000 42%, transparent 86%);
  mask-image: radial-gradient(ellipse 82% 88% at 50% 45%, #000 42%, transparent 86%);
}

.pet-stage.is-eating:not([data-species="dog"]) video {
  transform: scale(1.04);
  -webkit-mask-image: radial-gradient(ellipse 74% 82% at 50% 45%, #000 38%, transparent 84%);
  mask-image: radial-gradient(ellipse 74% 82% at 50% 45%, #000 38%, transparent 84%);
}

.pet-stage.is-eating:not([data-species="dog"]).is-video video {
  transform: scale(1.03);
}

.media-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 24px;
  background-image: url("../assets/paper.svg");
  background-size: 230px 230px;
  mix-blend-mode: multiply;
  opacity: .14;
  pointer-events: none;
}

.pet-stage.is-eating {
  z-index: 6;
  filter: drop-shadow(0 16px 23px rgba(131, 81, 49, .14));
}

.pet-stage.is-sleeping {
  bottom: 24%;
  left: 17.2%;
  z-index: 4;
  width: 210px;
  height: 200px;
  transform: translateX(-50%) rotate(-5deg);
}

.pet-stage.is-sleeping img {
  filter:
    saturate(.9)
    contrast(.98)
    drop-shadow(0 8px 8px rgba(120, 73, 43, .12));
}

.pet-stage.is-sleeping video {
  object-fit: cover;
  object-position: center 46%;
  transform: scale(1.18);
  filter: saturate(1.12) contrast(1.08) brightness(.98);
  -webkit-mask-image: radial-gradient(ellipse 72% 76% at 50% 45%, #000 40%, transparent 84%);
  mask-image: radial-gradient(ellipse 72% 76% at 50% 45%, #000 40%, transparent 84%);
}

.pet-stage.is-sleeping[data-species="dog"] video {
  transform: scale(1.02);
  filter: sepia(.2) brightness(.95) contrast(1.05) saturate(1.08);
  -webkit-mask-image: radial-gradient(ellipse 94% 94% at 50% 48%, #000 65%, transparent 98%);
  mask-image: radial-gradient(ellipse 94% 94% at 50% 48%, #000 65%, transparent 98%);
}

.pet-stage.is-sleeping[data-species="dog"].is-video video {
  transform: scale(1);
}

.pet-stage.is-sleeping.is-video video {
  transform: scale(1.16);
}

.pet-stage.is-sleeping[data-species="dog"].is-video video {
  transform: scale(1.1);
}

.pet-stage.is-sleeping .media-grain {
  border-radius: 20px;
}

.pet-zzz {
  position: absolute;
  top: 5%;
  right: 8%;
  z-index: 4;
  color: #b38e73;
  font-family: var(--hand);
  font-size: 18px;
  letter-spacing: .1em;
  opacity: 0;
  pointer-events: none;
}

.pet-stage.is-sleeping .pet-zzz {
  opacity: .8;
  animation: zzz-float 2.4s ease-in-out infinite;
}

@keyframes zzz-float {
  0%, 100% { transform: translateY(0); opacity: .35; }
  50% { transform: translateY(-7px); opacity: .85; }
}

.pet-status-bubble {
  position: absolute;
  right: 23%;
  bottom: 32%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 190px;
  padding: 9px 12px 9px 10px;
  border: 1px solid rgba(203, 165, 133, .5);
  border-radius: 15px 16px 5px 16px;
  background: rgba(255, 251, 243, .9);
  color: #856955;
  font-family: var(--hand);
  font-size: 12.5px;
  letter-spacing: .02em;
  line-height: 1.45;
  box-shadow: 0 8px 17px -14px rgba(125, 77, 46, .35);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}

.bubble-dot {
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e1a583;
}

.bubble-tail {
  position: absolute;
  right: 12px;
  bottom: -7px;
  width: 13px;
  height: 13px;
  border-right: 1px solid rgba(203, 165, 133, .5);
  border-bottom: 1px solid rgba(203, 165, 133, .5);
  border-radius: 0 0 4px 0;
  background: #fffaf2;
  transform: skewY(30deg) rotate(10deg);
}

.pet-room.is-eating .pet-status-bubble {
  opacity: .8;
}

.room-tools {
  position: absolute;
  top: 10%;
  right: 3.2%;
  z-index: 7;
  width: 156px;
  padding: 14px 12px 12px;
  border: 1px solid rgba(203, 163, 128, .5);
  border-radius: 22px 25px 21px 24px;
  background: rgba(255, 251, 243, .86);
  box-shadow: 0 13px 27px -22px rgba(127, 80, 48, .38);
  transform: rotate(.7deg);
  backdrop-filter: blur(8px);
}

.tools-title {
  color: #735745;
  font-family: var(--hand);
  font-size: 15px;
  letter-spacing: .1em;
  text-align: center;
}

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 9px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 39px;
  padding: 4px 7px;
  border: 1px dashed transparent;
  border-radius: 11px;
  color: #7b5c48;
  font-family: var(--hand);
  font-size: 11.5px;
  letter-spacing: .02em;
  text-align: left;
  transition: background .2s, border-color .2s, transform .2s;
}

.tool-btn[hidden] {
  display: none !important;
}

.tool-btn:hover {
  border-color: rgba(192, 143, 105, .45);
  background: rgba(255, 251, 243, .8);
  transform: translateX(-1px);
}

.tool-btn.is-suggested {
  border-color: rgba(206, 145, 102, .55);
  background: rgba(250, 231, 213, .68);
  box-shadow: 0 0 0 3px rgba(238, 194, 160, .12);
}

.tool-btn:disabled {
  cursor: wait;
  opacity: .55;
}

.tool-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.tool-icon svg {
  width: 16px;
  height: 16px;
}

.tool-icon.food {
  background: #f8e4c8;
  color: #b77a4e;
}

.tool-icon.water {
  background: #e2eff0;
  color: #7498a0;
}

.tool-icon.play {
  background: #f6ddd5;
  color: #b77762;
}

.write-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 37px;
  margin-top: 10px;
  border: 1px solid rgba(197, 128, 83, .4);
  border-radius: 999px;
  background: linear-gradient(180deg, #efb58c, #e59b72);
  color: #fff9ef;
  font-family: var(--hand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  box-shadow: 0 7px 14px -10px rgba(159, 84, 46, .55);
  transition: transform .2s, filter .2s;
}

.write-letter svg {
  width: 13px;
  height: 13px;
}

.write-letter:hover {
  filter: saturate(1.04);
  transform: translateY(-1px);
}

.drag-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  z-index: 6;
  padding: 5px 12px;
  border: 1px dashed rgba(186, 139, 104, .44);
  border-radius: 999px;
  background: rgba(255, 251, 243, .5);
  color: #a18773;
  font-family: var(--hand);
  font-size: 11px;
  letter-spacing: .02em;
  transform: translateX(-50%);
  white-space: nowrap;
  transition: opacity .25s;
}

.pet-room.is-dragging .drag-hint,
.pet-room.is-sleeping .drag-hint,
.pet-room.is-busy .drag-hint {
  opacity: 0;
}

.pet-room.is-dragging .pet-stage {
  z-index: 9;
  transition: none;
}

.pet-room.is-dragging .pet-stage img {
  filter:
    saturate(1.08)
    contrast(1.04)
    drop-shadow(0 16px 13px rgba(124, 73, 41, .2));
}

.pet-room.is-over-bed .drag-hint {
  color: #a45f3d;
  border-color: rgba(194, 127, 85, .7);
  background: rgba(253, 237, 221, .9);
}

.pet-room.is-dragging .pet-stage {
  z-index: 9;
  transition: none;
  transform: translate(calc(-50% + var(--drag-x, 0px)), var(--drag-y, 0px));
  cursor: grabbing;
}

.pet-room.is-dragging .pet-stage img {
  filter:
    saturate(1.08)
    contrast(1.04)
    drop-shadow(0 16px 13px rgba(124, 73, 41, .2));
}

.pet-stage.is-drinking img {
  animation: pet-sip .8s ease-in-out infinite;
}

.pet-stage.is-playing img {
  animation: pet-hop .55s ease-in-out infinite;
}

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

@keyframes pet-hop {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  45% { transform: translateY(-14px) rotate(1.5deg); }
  70% { transform: translateY(0) rotate(0); }
}

.home-state-pill[data-state="eating"] {
  border-color: rgba(209, 154, 104, .55);
  background: rgba(250, 232, 210, .78);
  color: #9d643c;
}

.home-state-pill[data-state="eating"] .state-dot {
  background: #d68f58;
  box-shadow: 0 0 0 3px rgba(214, 143, 88, .16);
}

.home-state-pill[data-state="drinking"] {
  border-color: rgba(144, 176, 184, .5);
  background: rgba(228, 240, 240, .75);
  color: #5f7f87;
}

.home-state-pill[data-state="drinking"] .state-dot {
  background: #86aab3;
  box-shadow: 0 0 0 3px rgba(134, 170, 179, .16);
}

.home-state-pill[data-state="playing"] {
  border-color: rgba(215, 150, 135, .5);
  background: rgba(250, 229, 223, .8);
  color: #a56352;
}

.home-state-pill[data-state="playing"] .state-dot {
  background: #d58f7e;
  box-shadow: 0 0 0 3px rgba(213, 143, 126, .16);
}

.pet-room.is-sleeping .pet-status-bubble {
  right: auto;
  bottom: 40%;
  left: 27%;
}

.pet-room.is-sleeping .drag-hint {
  opacity: 0;
}

/* =========================================================
   小猫 / 小狗 / 小兔：各自的小窝
   ========================================================= */
.room-bed[data-species="cat"] {
  bottom: 17%;
  left: 5%;
  width: 292px;
  height: 290px;
}

.room-bed[data-species="bunny"] {
  bottom: 16%;
  left: 5%;
  width: 302px;
  height: 267px;
}

.room-bed[data-species="dog"] {
  bottom: 17%;
  left: 4%;
  width: 286px;
  height: 318px;
}

.room-bed[data-species="cat"] .bed-label,
.room-bed[data-species="bunny"] .bed-label,
.room-bed[data-species="dog"] .bed-label {
  bottom: -24px;
  font-size: 13px;
}

.sleep-scene {
  position: absolute;
  bottom: 9%;
  left: 4%;
  z-index: 5;
  width: 365px;
  height: 420px;
  cursor: pointer;
  outline: none;
  animation: sleep-scene-in .55s var(--ease) both;
}

.sleep-scene[hidden] {
  display: none;
}

.sleep-scene[data-species="bunny"] {
  bottom: 7%;
  left: 5%;
  width: 330px;
  height: 420px;
}

.sleep-scene[data-species="dog"] {
  bottom: 10%;
  left: 3%;
  width: 380px;
  height: 380px;
}

.sleep-scene img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 18px 18px rgba(130, 80, 49, .16));
}

.sleep-scene-zzz {
  display: none;
  position: absolute;
  top: 2%;
  right: 4%;
  color: #a6856f;
  font-family: var(--hand);
  font-size: 21px;
  letter-spacing: .12em;
  text-shadow: 0 1px 0 rgba(255, 250, 240, .7);
  animation: zzz-float 2.8s ease-in-out infinite;
}

.sleep-scene.is-asleep .sleep-scene-zzz {
  display: block;
}

.sleep-scene-hint {
  position: absolute;
  right: 0;
  bottom: -2%;
  left: 0;
  color: #a1846f;
  font-family: var(--hand);
  font-size: 11px;
  letter-spacing: .08em;
  text-align: center;
  opacity: .85;
}

.pet-room.has-nest-scene .room-bed,
.pet-room.has-nest-scene .bed-label {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pet-room.has-nest-scene .pet-stage {
  opacity: 0;
  pointer-events: none;
}

.pet-room.has-nest-scene .drag-hint {
  opacity: 0;
}

.pet-room.has-nest-scene .pet-status-bubble {
  right: auto;
  bottom: 46%;
  left: 31%;
}

.room-bed[data-nest="special"] {
  bottom: 12%;
  left: 4%;
  width: 300px;
  height: 360px;
}

.room-bed[data-nest="default"] {
  bottom: 25%;
  left: 6%;
  width: 270px;
  height: 188px;
}

.nest-toggle {
  position: absolute;
  top: 3%;
  bottom: auto;
  left: 4%;
  z-index: 9;
  min-height: 34px;
  padding: 0 17px;
  border: 1px solid rgba(190, 110, 66, .35);
  border-radius: 999px;
  background: rgba(255, 249, 239, .92);
  color: #ac6e4a;
  font-family: var(--hand);
  font-size: 11px;
  letter-spacing: .05em;
  box-shadow: 0 7px 14px -13px rgba(112, 65, 38, .5);
}

.nest-toggle:hover {
  background: #fbe7d5;
}

.nest-drag-handle {
  position: absolute;
  top: 8%;
  right: 5%;
  z-index: 7;
  padding: 4px 10px;
  border: 1px dashed rgba(172, 110, 74, .45);
  border-radius: 999px;
  background: rgba(255, 249, 239, .78);
  color: #a8795b;
  font-family: var(--hand);
  font-size: 9px;
  letter-spacing: .06em;
  cursor: grab;
}

.nest-drag-handle:active {
  cursor: grabbing;
}

@keyframes sleep-scene-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  .room-bed[data-species="cat"],
  .room-bed[data-species="bunny"],
  .room-bed[data-species="dog"] {
    left: 4%;
    width: 210px;
    height: 210px;
  }

  .sleep-scene,
  .sleep-scene[data-species="bunny"],
  .sleep-scene[data-species="dog"] {
    left: 3%;
    width: 260px;
    height: 310px;
  }

  .pet-room.has-nest-scene .pet-status-bubble {
    left: 27%;
    bottom: 51%;
  }
}

@media (max-width: 620px) {
  .nest-toggle {
    top: 2%;
    left: 3%;
    min-height: 29px;
    padding: 0 12px;
    font-size: 9.5px;
  }

  .nest-drag-handle {
    top: 4%;
    right: 3%;
    font-size: 8px;
  }

  .room-bed[data-nest="special"] {
    bottom: 18%;
    left: 3%;
    width: 170px;
    height: 205px;
  }

  .room-bed[data-nest="default"] {
    bottom: 24%;
    left: 3%;
    width: 150px;
    height: 110px;
  }

  .sleep-scene,
  .sleep-scene[data-species="bunny"],
  .sleep-scene[data-species="dog"] {
    bottom: 17%;
    left: 2%;
    width: 188px;
    height: 230px;
  }

  .sleep-scene-zzz {
    top: 3%;
    right: 2%;
    font-size: 15px;
  }

  .sleep-scene-hint {
    bottom: -7%;
    font-size: 9px;
  }

  .pet-room.has-nest-scene .pet-status-bubble {
    right: 7%;
    bottom: 48%;
    left: auto;
  }
}

@media (max-width: 900px) {
  .room-bed[data-nest="special"] {
    bottom: 15%;
    left: 3%;
    width: 220px;
    height: 265px;
  }
}

@media (max-width: 620px) {
  .pet-room.is-sleeping .pet-status-bubble {
    top: auto;
    right: 8%;
    bottom: 47%;
    left: auto;
  }
}

/* =========================================================
   写信 / 收信匣
   ========================================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.compose-view,
.letters-view {
  width: min(980px, 100%);
  margin: 0 auto;
  padding-top: 2px;
}

.letter-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 42px;
}

.letter-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 11px 0 9px;
  border: 1px dashed rgba(190, 144, 109, .45);
  border-radius: 999px;
  background: rgba(255, 251, 243, .48);
  color: #997b66;
  font-family: var(--hand);
  font-size: 11px;
  transition: background .2s, border-color .2s;
}

.letter-back svg {
  width: 12px;
  height: 12px;
  transform: rotate(180deg);
}

.letter-back:hover {
  border-color: rgba(169, 111, 75, .8);
  background: rgba(255, 251, 243, .9);
}

.compose-author {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 4px;
}

.compose-avatar {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid rgba(207, 167, 135, .55);
  border-radius: 50%;
  background: linear-gradient(145deg, #f5d9c5, #eec5aa);
  color: #9c6447;
  font-family: var(--hand);
  font-size: 14px;
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, .5);
}

.compose-author-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.compose-author-copy b {
  color: #584133;
  font-family: var(--hand);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .03em;
}

.compose-author-copy small {
  color: #ad9380;
  font-family: var(--hand);
  font-size: 9.5px;
}

.compose-attach-wrap {
  margin-left: auto;
  text-align: right;
}

.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: #735747;
  font-family: var(--hand);
  font-size: 13px;
  letter-spacing: .03em;
}

.attach-plus {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(180, 139, 108, .7);
  border-radius: 50%;
  background: rgba(255, 251, 243, .72);
  color: #9f7257;
  box-shadow: 0 3px 8px -6px rgba(125, 77, 46, .4);
  transition: transform .2s, background .2s;
}

.attach-plus svg {
  width: 15px;
  height: 15px;
}

.attach-btn:hover .attach-plus {
  transform: rotate(90deg);
  background: #fffaf2;
}

.attach-hint {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 3px;
  color: #ad917b;
  font-family: var(--hand);
  font-size: 9px;
}

.attach-hint span {
  padding: 2px 7px;
  border: 1px solid rgba(205, 172, 145, .38);
  border-radius: 999px;
  background: rgba(255, 251, 243, .36);
}

.attach-hint .is-muted {
  color: #c0aa99;
}

.letter-sheet {
  position: relative;
  width: min(820px, 100%);
  min-height: 570px;
  margin: 12px auto 0;
  padding: 43px 54px 34px;
  border: 1px solid rgba(194, 157, 122, .48);
  border-radius: 25px 31px 24px 29px;
  background:
    radial-gradient(ellipse at 16% 12%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 42%),
    linear-gradient(145deg, #fffaf0 0%, #fbf1df 52%, #f8e9d3 100%);
  box-shadow:
    0 26px 56px -38px rgba(122, 77, 47, .45),
    0 2px 0 rgba(255, 255, 255, .7) inset;
  transform: rotate(-.25deg);
}

.letter-sheet::before {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: 0;
  border: 1px dashed rgba(192, 153, 117, .23);
  border-radius: 20px 25px 19px 24px;
  pointer-events: none;
}

.letter-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  opacity: .2;
  mix-blend-mode: multiply;
  background-image: url("../assets/paper.svg");
  background-size: 420px 420px;
  pointer-events: none;
}

.letter-sheet-curl {
  display: none;
}

.letter-sheet-tape {
  position: absolute;
  top: -12px;
  right: 17%;
  z-index: 4;
  width: 87px;
  height: 25px;
  background: rgba(231, 203, 165, .55);
  transform: rotate(2.5deg);
  box-shadow: 0 2px 4px -3px rgba(134, 88, 54, .2);
  pointer-events: none;
}

.letter-chick {
  position: absolute;
  z-index: 2;
  width: 116px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 11px rgba(137, 86, 52, .13));
  pointer-events: none;
}

.letter-chick-one {
  bottom: 116px;
  left: -35px;
  transform: rotate(-8deg);
}

.letter-chick-two {
  right: 19px;
  bottom: 15px;
  width: 96px;
  transform: rotate(5deg);
}

.letter-doodle {
  position: absolute;
  z-index: 2;
  color: #efb9ad;
  font-family: var(--hand);
  pointer-events: none;
}

.heart-a {
  top: 13%;
  left: 6%;
  font-size: 18px;
  transform: rotate(-13deg);
}

.heart-b {
  top: 21%;
  right: 7%;
  font-size: 14px;
  transform: rotate(12deg);
}

.spark-a {
  top: 38%;
  right: 10%;
  color: #e7c98f;
  font-size: 13px;
}

.letter-sheet-inner {
  position: relative;
  z-index: 5;
}

.letter-date-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.letter-date {
  flex: none;
  color: #a88c76;
  font-family: var(--hand);
  font-size: 12px;
  letter-spacing: .08em;
}

.letter-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(202, 169, 137, .4), rgba(202, 169, 137, 0));
}

.letter-input {
  display: block;
  width: 100%;
  min-height: 338px;
  margin-top: 16px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #4d3427;
  font-family: var(--hand);
  font-size: clamp(18px, 1.65vw, 22px);
  font-weight: 500;
  line-height: 2.05;
  letter-spacing: .025em;
  resize: none;
  caret-color: #d9875e;
}

.letter-input::placeholder {
  color: #b39a85;
  opacity: .85;
}

.letter-error {
  min-height: 16px;
  margin-top: 4px;
  color: #bd6652;
  font-family: var(--hand);
  font-size: 11px;
}

.letter-image-preview {
  position: relative;
  width: 134px;
  height: 104px;
  margin-top: 7px;
  border: 1px solid rgba(204, 165, 132, .6);
  border-radius: 11px;
  overflow: hidden;
  background: #fffaf2;
  box-shadow: 0 6px 13px -10px rgba(123, 76, 45, .35);
}

.letter-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.letter-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(76, 51, 38, .48);
  color: #fff9ef;
}

.letter-image-remove svg {
  width: 11px;
  height: 11px;
}

.letter-send-row {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.letter-send {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 228px;
  height: 49px;
  overflow: hidden;
  border: 1px solid rgba(177, 96, 55, .32);
  border-radius: 999px;
  background: linear-gradient(180deg, #e9a37a 0%, #df9168 58%, #d8865e 100%);
  color: #fff9ef;
  font-family: var(--hand);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  box-shadow:
    0 13px 22px -17px rgba(151, 78, 42, .65),
    inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .2s, filter .2s;
}

.letter-send svg {
  width: 17px;
  height: 17px;
}

.letter-send:hover {
  filter: saturate(1.05);
  transform: translateY(-1px);
}

.letter-send:disabled {
  cursor: wait;
  opacity: .65;
}

.letter-send-wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 25% 0%, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 54%);
  pointer-events: none;
}

.letter-note {
  margin-top: 18px;
  color: #a88e7b;
  font-family: var(--hand);
  font-size: 11px;
  text-align: center;
  letter-spacing: .04em;
}

.letter-note span {
  color: #dfa58d;
}

.letter-paper-status {
  margin-top: 6px;
  color: #9a7d69;
  font-family: var(--hand);
  font-size: 10.5px;
  text-align: center;
  letter-spacing: .04em;
}

.letter-paper-status.is-empty {
  color: #b46f58;
}

.letter-topbar-mark {
  margin-left: auto;
  color: #b39985;
  font-family: "Trebuchet MS", var(--sans);
  font-size: 9px;
  letter-spacing: .19em;
}

.letters-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 25px;
}

.letters-heading h1 {
  margin-top: 7px;
  color: #473226;
  font-family: var(--serif);
  font-size: clamp(38px, 4.2vw, 55px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.18;
}

.letter-write-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(183, 104, 61, .32);
  border-radius: 999px;
  background: linear-gradient(180deg, #e9a37a, #da8b62);
  color: #fff9ef;
  font-family: var(--hand);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: 0 11px 19px -16px rgba(151, 78, 42, .6);
  transition: transform .2s, filter .2s;
}

.letter-write-btn svg {
  width: 16px;
  height: 16px;
}

.letter-write-btn:hover {
  filter: saturate(1.04);
  transform: translateY(-1px);
}

.letters-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: min(780px, 100%);
  margin: 24px auto 0;
}

.letter-card {
  position: relative;
  padding: 19px 25px 20px;
  border: 1px solid rgba(202, 164, 129, .43);
  border-radius: 17px 21px 16px 20px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg, #fffaf2, #fbf0df);
  box-shadow:
    0 14px 28px -25px rgba(126, 79, 47, .4),
    inset 0 1px 0 rgba(255, 255, 255, .65);
  transform: rotate(-.15deg);
}

.letter-card:nth-child(even) {
  transform: rotate(.2deg);
}

.letter-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9f826b;
  font-family: var(--hand);
  font-size: 11px;
}

.letter-card-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f3d5be, #eac3a7);
  color: #966248;
  font-size: 11px;
}

.letter-card-author {
  color: #765845;
  font-size: 12px;
  font-weight: 600;
}

.letter-card time {
  margin-left: 2px;
  color: #b49a85;
  font-size: 10px;
}

.letter-card-heart {
  margin-left: auto;
  color: #df9c86;
  font-size: 20px;
  line-height: 1;
}

.letter-card-heart svg {
  display: block;
  width: 19px;
  height: 19px;
}

.letter-card-body {
  margin-top: 13px;
  color: #564032;
  font-family: var(--hand);
  font-size: 17px;
  line-height: 1.95;
  letter-spacing: .025em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.letter-card-image {
  display: block;
  max-width: min(100%, 460px);
  max-height: 340px;
  margin-top: 12px;
  border: 1px solid rgba(204, 165, 132, .45);
  border-radius: 12px;
  object-fit: cover;
}

.letters-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(580px, 100%);
  margin: 65px auto 0;
  padding: 38px 30px;
  border: 1px dashed rgba(194, 152, 116, .45);
  border-radius: 24px;
  background: rgba(255, 251, 243, .38);
  text-align: center;
}

.empty-letter-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f6e3d0;
  color: #b57b59;
}

.empty-letter-icon svg {
  width: 24px;
  height: 24px;
}

.letters-empty h2 {
  margin-top: 13px;
  color: #5a4030;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}

.letters-empty p {
  margin-top: 5px;
  color: #9b806d;
  font-family: var(--hand);
  font-size: 12px;
}

.letters-empty .letter-write-btn {
  margin-top: 18px;
}

@media (max-width: 900px) {
  .letter-sheet {
    padding: 36px 38px 30px;
  }

  .letter-chick-one {
    left: -22px;
    width: 96px;
  }

  .letter-chick-two {
    right: 12px;
    width: 82px;
  }

  .letter-input {
    min-height: 310px;
  }
}

@media (max-width: 620px) {
  .compose-view,
  .letters-view {
    width: 100%;
  }

  .letter-topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .compose-author {
    gap: 7px;
  }

  .compose-attach-wrap {
    margin-left: 0;
  }

  .attach-hint {
    justify-content: flex-start;
  }

  .letter-sheet {
    min-height: 0;
    margin-top: 18px;
    padding: 32px 22px 27px;
    border-radius: 20px 25px 19px 24px;
  }

  .letter-sheet-curl {
    display: none;
  }

  .letter-chick {
    opacity: .62;
  }

  .letter-chick-one {
    bottom: 100px;
    left: -28px;
    width: 76px;
  }

  .letter-chick-two {
    right: -7px;
    bottom: 8px;
    width: 64px;
  }

  .letter-date-row {
    gap: 8px;
  }

  .letter-input {
    min-height: 330px;
    margin-top: 10px;
    font-size: 18px;
    line-height: 1.95;
  }

  .letter-send {
    width: 100%;
  }

  .letter-image-preview {
    width: 116px;
    height: 91px;
  }

  .letter-note {
    margin-top: 13px;
    font-size: 9.5px;
  }

  .letters-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    margin-top: 18px;
  }

  .letters-heading h1 {
    font-size: 38px;
  }

  .letters-heading .letter-write-btn {
    align-self: flex-end;
  }

  .letters-list {
    margin-top: 17px;
    gap: 11px;
  }

  .letter-card {
    padding: 16px 17px;
  }

  .letter-card-body {
    margin-top: 10px;
    font-size: 15.5px;
    line-height: 1.9;
  }

  .letters-empty {
    margin-top: 35px;
    padding: 28px 20px;
  }
}

@media (max-width: 1180px) {
  .room-tools {
    right: 2.5%;
    width: 146px;
  }

  .room-bed {
    left: 4.5%;
    width: 245px;
    height: 172px;
  }

  .pet-status-bubble {
    right: 23%;
  }
}

@media (max-width: 940px) {
  .invite-label {
    display: none;
  }

  .setup-view {
    min-height: 0;
    padding: 20px 0 30px;
  }

  .setup-paper {
    padding: 31px 26px 25px;
  }

  .home-heading h1 {
    font-size: 42px;
  }

  .pet-room {
    height: 520px;
  }

  .room-bed {
    bottom: 25%;
    left: 5%;
    width: 210px;
    height: 150px;
  }

  .bed-label {
    bottom: -25px;
    font-size: 12px;
  }

  .pet-stage {
    bottom: 9%;
    width: 255px;
    height: 355px;
  }

  .pet-stage.is-sleeping {
    bottom: 28%;
    width: 170px;
    height: 165px;
  }

  .pet-status-bubble {
    right: 22%;
    bottom: 35%;
    font-size: 11.5px;
  }

  .room-tools {
    top: 9%;
    right: 2.6%;
    width: 140px;
    padding: 12px 10px 10px;
  }

  .tool-btn {
    font-size: 10.5px;
    min-height: 36px;
  }

  .tool-icon {
    width: 25px;
    height: 25px;
  }

  .tool-icon svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 620px) {
  .app-user .invite-chip {
    height: 29px;
    padding: 0 7px;
    font-size: 9.5px;
  }

  .app-user .invite-chip b {
    font-size: 10px;
  }

  .setup-paper {
    padding: 27px 19px 22px;
    border-radius: 25px 29px 23px 27px;
  }

  .setup-paper h1 {
    font-size: 32px;
  }

  .setup-paper .app-lede {
    font-size: 12px;
  }

  .setup-input-row {
    flex-wrap: wrap;
  }

  .setup-input-row input {
    flex-basis: 100%;
  }

  .setup-input-row button {
    width: 100%;
  }

  .home-heading {
    align-items: flex-start;
  }

  .home-heading h1 {
    font-size: 36px;
  }

  .home-state-pill {
    min-height: 30px;
    padding: 0 9px;
    font-size: 10.5px;
  }

  .home-pet-meta {
    font-size: 10.5px;
  }

  .pet-room {
    height: 530px;
    margin-top: 12px;
    border-radius: 25px 29px 23px 27px;
  }

  .room-floor {
    height: 52%;
  }

  .room-bed {
    bottom: 40%;
    left: 3%;
    width: 122px;
    height: 84px;
  }

  .bed-label {
    bottom: -21px;
    font-size: 10px;
  }

  .bed-moon {
    font-size: 20px;
  }

  .pet-stage {
    bottom: 27%;
    left: 53%;
    width: 176px;
    height: 246px;
  }

  .pet-stage.is-sleeping {
    bottom: 24%;
    left: 24%;
    width: 116px;
    height: 112px;
  }

  .pet-stage.is-eating {
    bottom: 28%;
    width: 190px;
    height: 272px;
  }

  .pet-status-bubble {
    top: 13%;
    right: 6%;
    bottom: auto;
    left: auto;
    max-width: 142px;
    padding: 7px 9px;
    font-size: 10.5px;
  }

  .room-tools {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    width: auto;
    padding: 7px;
    border-radius: 17px;
    transform: none;
  }

  .tools-title {
    display: none;
  }

  .tool-list {
    flex: 1;
    flex-direction: row;
    gap: 4px;
    margin-top: 0;
  }

  .tool-btn {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 49px;
    padding: 4px 2px;
    border-color: rgba(208, 179, 153, .25);
    font-size: 9.5px;
    text-align: center;
  }

  .tool-icon {
    width: 24px;
    height: 24px;
  }

  .tool-icon svg {
    width: 13px;
    height: 13px;
  }

  .write-letter {
    flex: none;
    width: 63px;
    height: 48px;
    margin-top: 0;
    font-size: 10.5px;
  }

  .drag-hint {
    top: 8%;
    right: auto;
    bottom: auto;
    left: 5%;
    max-width: 150px;
    padding: 4px 8px;
    font-size: 9.5px;
    text-align: left;
    white-space: normal;
    border: 0;
    background: transparent;
    transform: none;
  }

  .pet-room.is-sleeping .drag-hint {
    display: none;
  }
}

