:root {
  --lilac: #E3D9F0;
  --lilac-deep: #D3C5E8;
  --mint: #2CC9A0;
  --mint-dark: #1E9C7B;
  --plum: #3B2A4A;
  --blush: #F4A7B9;
  --butter: #F6E7A1;
  --display: "Mochiy Pop One", "Hiragino Maru Gothic ProN", sans-serif;
  --body: "Varela Round", system-ui, sans-serif;
  /* flocked damask wallpaper: a soft raised motif in a slightly deeper lilac */
  --damask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='110' viewBox='0 0 80 110'%3E%3Cg fill='%23C9B8E2' fill-opacity='.55'%3E%3Cpath d='M40 8c6 10 16 14 16 26 0 9-7 14-12 12 4-4 4-11-4-15-8 4-8 11-4 15-5 2-12-3-12-12 0-12 10-16 16-26z'/%3E%3Cpath d='M40 50c3 6 9 8 9 15s-5 10-9 13c-4-3-9-6-9-13s6-9 9-15z'/%3E%3Cpath d='M40 80c2 4 6 6 6 10s-3 7-6 9c-3-2-6-5-6-9s4-6 6-10z'/%3E%3Ccircle cx='0' cy='55' r='5'/%3E%3Ccircle cx='80' cy='55' r='5'/%3E%3Cpath d='M0 0c3 6 8 8 8 13s-5 8-8 10M80 0c-3 6-8 8-8 13s5 8 8 10' /%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--lilac); color: var(--plum); font: 17px/1.6 var(--body); }
a { color: var(--mint-dark); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 16px clamp(16px, 4vw, 48px); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--plum); font: 26px/1 var(--display); }
.connect { background: var(--plum); color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font-size: 15px; }

main { max-width: 1080px; margin: 0 auto; padding: 0 clamp(12px, 4vw, 40px) 40px; }

/* ---------- the room, seen from the side */
.room {
  position: relative; height: min(640px, 92vw + 180px); border-radius: 36px; overflow: hidden;
  background: var(--lilac-deep) var(--damask);
  border: 4px solid var(--plum); box-shadow: 0 10px 0 var(--plum);
}
.room::after { /* skirting board and floor */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 28%;
  background: repeating-linear-gradient(90deg, #EAD6B8 0 120px, #E2CCAA 120px 122px);
  border-top: 10px solid #fff; box-shadow: inset 0 4px 0 rgba(59, 42, 74, 0.12);
}
.window { position: absolute; right: 8%; top: 13%; width: 120px; height: 140px; background: #CFEFF8; border: 6px solid #fff; border-radius: 60px 60px 8px 8px; box-shadow: 0 0 0 3px var(--plum); display: grid; grid-template-columns: 1fr 1fr; }
.window span { border-right: 4px solid #fff; }
.window span:last-child { border: 0; }

.tags { position: absolute; left: 6%; top: 0; display: flex; gap: 18px; z-index: 2; }
.tag {
  position: relative; margin-top: 46px; width: 112px; padding: 12px 10px 10px; text-align: center;
  background: #fff; border: 3px solid var(--plum); border-radius: 14px; transform-origin: 50% -46px;
  animation: sway 4s ease-in-out infinite alternate;
}
.tag:nth-child(2) { margin-top: 70px; transform-origin: 50% -70px; animation-delay: -1.3s; }
.tag:nth-child(3) { margin-top: 34px; transform-origin: 50% -34px; animation-delay: -2.6s; }
.tag::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 3px; height: 200px; background: var(--plum); margin-left: -1.5px; }
.tag::after { content: ""; position: absolute; left: 50%; top: 6px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--plum); }
.tag-name { display: block; font: 15px/1.2 var(--display); margin-top: 6px; }
.bar { display: block; height: 10px; border-radius: 6px; background: var(--lilac); margin: 8px 0 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--mint); border-radius: 6px; transition: width 0.8s ease; }
.tag.low .bar i { background: var(--blush); }
.tag b { font-family: var(--display); font-weight: 400; font-size: 15px; }
@keyframes sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }

.mood { position: absolute; left: 0; right: 0; top: 41%; text-align: center; font: clamp(17px, 2.2vw, 22px)/1.3 var(--display); z-index: 1; margin: 0; padding: 0 16px; }

.pet-spot { position: absolute; left: 50%; bottom: 20%; width: min(260px, 58%); transform: translateX(-50%); z-index: 1; }
.pet { display: block; width: 100%; height: auto; overflow: visible; }
.blob { fill: #FFFDF8; stroke: var(--plum); stroke-width: 5; }
.shine { fill: #fff; }
.shadow { fill: rgba(59, 42, 74, 0.18); }
.cheek { fill: var(--blush); opacity: 0.9; }
.face circle, .face path { fill: var(--plum); }
.face-line { fill: none; stroke: var(--plum); stroke-width: 5; stroke-linecap: round; }
#dirt circle { fill: #9C8566; opacity: 0; transition: opacity 0.6s; }
.pet.dirty #dirt circle { opacity: 0.7; }
#body { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; }
.pet.sad #body { animation-duration: 5s; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, 0.975); } }
.pet.jelly #body { animation: jelly 1.1s cubic-bezier(.3, 0, .3, 1); }
@keyframes jelly {
  0% { transform: translateY(0) scale(1, 1); }
  14% { transform: translateY(0) scale(1.22, 0.74); }
  34% { transform: translateY(-26%) scale(0.86, 1.18); }
  52% { transform: translateY(0) scale(1.16, 0.84); }
  66% { transform: translateY(0) scale(0.94, 1.07); }
  80% { transform: translateY(0) scale(1.04, 0.97); }
  100% { transform: translateY(0) scale(1, 1); }
}
.heart { position: absolute; left: 50%; top: 0; margin-left: -22px; opacity: 0; pointer-events: none; }
.heart.puff { animation: puff 1.4s ease-out 0.25s; }
@keyframes puff {
  0% { opacity: 0; transform: translateY(20px) scale(0.4); }
  25% { opacity: 1; transform: translateY(-20px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-110px) scale(0.9) rotate(10deg); }
}

.floor { position: absolute; left: 0; right: 0; bottom: 4%; display: flex; justify-content: center; gap: clamp(14px, 4vw, 46px); z-index: 2; }
.toy {
  display: grid; justify-items: center; gap: 2px; background: #fff; border: 3px solid var(--plum); border-radius: 22px;
  padding: 10px 16px 8px; color: var(--plum); box-shadow: 0 5px 0 var(--plum); transition: transform 0.12s;
}
.toy span { font: 16px/1 var(--display); }
.toy:hover:not(:disabled) { transform: translateY(-3px) rotate(-2deg); }
.toy:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--plum); }
.toy:disabled { opacity: 0.55; }

.note { text-align: center; min-height: 1.6em; margin: 22px 0 0; font-weight: 700; }
.note.bad { color: #B8456A; }
.rest { text-align: center; margin: 4px 0 0; font-size: 15px; min-height: 1.4em; }

.below { display: grid; grid-template-columns: 1fr 0.8fr 1.1fr; gap: 18px; margin-top: 28px; }
.card { background: #fff; border: 3px solid var(--plum); border-radius: 24px; padding: 20px 22px; }
.card h2 { font-size: 22px; margin-bottom: 10px; color: var(--plum); }
.carers ol { margin: 0; padding-left: 26px; }
.carers li { padding: 4px 0; }
.carers li span { float: right; font-family: var(--display); font-size: 14px; }
.carers li.me { color: var(--mint-dark); font-weight: 700; }
.carers .empty { list-style: none; margin-left: -26px; }
.stats p { margin: 6px 0; }
.stats b { font: 22px var(--display); font-weight: 400; color: var(--mint-dark); }
.how p { margin: 0 0 10px; font-size: 15px; }

.foot { margin-top: 44px; padding-top: 18px; border-top: 3px dotted var(--plum); font-size: 14px; }
.foot p { margin: 4px 0; overflow-wrap: anywhere; }
.foot .built { font: 19px/1.3 var(--display); }

@media (max-width: 820px) {
  .below { grid-template-columns: 1fr; }
  .window { display: none; }
}
@media (max-width: 520px) {
  .room { height: 600px; border-radius: 26px; }
  .tags { left: 50%; transform: translateX(-50%); gap: 8px; }
  .tag { width: 96px; padding: 10px 6px 8px; }
  .mood { top: 38%; }
  .pet-spot { width: 72%; bottom: 19%; }
  .toy { padding: 8px 10px 6px; }
  .toy svg { width: 48px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .tag, #body { animation: none !important; }
}
