/* Scene entrances stay attached to the illustrated world. */
.cottage-door {
  position: absolute;
  left: 14.5%;
  top: 28.5%;
  width: 3.6%;
  height: 11.1%;
  padding: 0;
  background: transparent;
  perspective: 350px;
}
.cottage-glow,
.cottage-leaf {
  position: absolute;
  inset: 0;
  border-radius: 3px 3px 0 0;
  opacity: 0;
}
.cottage-glow {
  background: radial-gradient(
    ellipse at 45% 70%,
    #ffe1a6,
    #a9632e 70%,
    #4b2b1e
  );
  box-shadow: 0 0 20px #ffc674;
  transition: opacity 0.25s;
}
.cottage-leaf {
  background: repeating-linear-gradient(90deg, #885326 0 8px, #a56f36 9px 14px);
  border: 3px solid #68411f;
  transform-origin: left;
  transition:
    transform 0.35s,
    opacity 0.2s;
}
.cottage-door:hover .cottage-glow {
  opacity: 0.3;
}
.cottage-door.is-opening .cottage-glow,
.cottage-door.is-opening .cottage-leaf {
  opacity: 1;
}
.cottage-door.is-opening .cottage-leaf {
  transform: rotateY(-85deg);
}
.place-label {
  position: absolute;
  top: 108%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #67462ced;
  color: #fff2ce;
  font-size: 11px;
  padding: 5px 10px;
  border: 1px solid #e4bb76;
  box-shadow: 2px 3px 0 #3c2d2280;
}
.board-sign {
  position: absolute;
  left: 32.5%;
  top: 39%;
  width: 9.2%;
  height: 14%;
  background: transparent;
  padding: 0 4%;
  filter: drop-shadow(3px 6px 2px #16281755);
}
.board-sign::before,
.board-sign::after {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 0;
  width: 7%;
  background: linear-gradient(90deg, #68402a, #b98851, #785136);
  border: 1px solid #583d28;
}
.board-sign::before {
  left: 15%;
}
.board-sign::after {
  right: 15%;
}
.board-roof {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 15%;
  background: #865634;
  border: 3px solid #bb8b58;
  transform: rotate(-2deg);
  z-index: 2;
}
.board-sign-face {
  position: absolute;
  inset: 10% 3% 23%;
  z-index: 1;
  background: #eee1bf;
  border: 7px solid #98643d;
  outline: 2px solid #513a28;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  color: #624b35;
}
.board-sign-face i {
  font-style: normal;
  color: #ad6677;
  font-size: 18px;
}
.board-sign-face b {
  font-family: KaiTi, serif;
  font-size: clamp(12px, 1.2vw, 19px);
}
.board-sign-face small {
  font-size: clamp(7px, 0.6vw, 10px);
}
.guide-open {
  position: absolute;
  right: 40px;
  bottom: 92px;
  background: #fcf3dfeb;
  border: 1px solid #bda787;
  padding: 9px 15px;
  box-shadow: 3px 3px 0 #18301e38;
  font-size: 12px;
  z-index: 6;
}
.guide-open span,
.room-help {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #bc9f78;
  border-radius: 50%;
  font-family: Georgia, serif;
  margin-right: 5px;
}
.place-shortcuts {
  display: none;
  position: absolute;
  top: 104px;
  left: 20px;
  gap: 8px;
  z-index: 6;
}
.place-shortcuts button {
  background: #fff3dfed;
  border: 1px solid #c4a579;
  padding: 9px 12px;
  font-size: 12px;
  box-shadow: 2px 3px 0 #293c2638;
}

/* A quiet room; animation belongs to the cat, never to a page-wide loop. */
dialog.cottage-dialog {
  -webkit-tap-highlight-color: transparent;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: #9a6c42;
  cursor:
    url("/assets/glove.svg") 17 4,
    pointer;
}
.cottage-dialog button {
  cursor: inherit;
}
.room-world {
  position: absolute;
  inset: 0;
  background: url("/assets/room.webp") center 63% / cover no-repeat;
  pointer-events: none;
}
.room-world::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    #3a241b66,
    transparent 32%,
    transparent 73%,
    #34241960
  );
}
.room-header {
  position: absolute;
  inset: 23px 30px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  z-index: 2;
}
.room-back,
.room-help {
  padding: 11px 16px;
  background: #fff3dfed;
  border: 1px solid #b59877;
  box-shadow: 3px 3px 0 #49341e45;
  font-size: 13px;
}
.room-help {
  width: 39px;
  height: 39px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}
.room-name {
  color: #fff6e2;
  text-align: center;
  text-shadow: 0 2px 3px #442a20;
}
.room-name .overline {
  color: #f3dcc2;
  letter-spacing: 3px;
  font-size: 9px;
}
.room-name h2 {
  font-size: 30px;
  font-weight: 500;
  margin: 5px 0;
  letter-spacing: 4px;
}
.room-name p {
  color: #f7e5cc;
  font-size: 11px;
}
.pet-status {
  position: absolute;
  top: 133px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  width: min(590px, calc(100% - 40px));
  z-index: 2;
}
.pet-stat {
  flex: 1;
  min-width: 0;
  padding: 12px 15px;
  background: #fff5e6f2;
  border: 1px solid #d2b58b;
  box-shadow: 3px 4px 0 #4b342831;
  border-radius: 4px;
}
.pet-stat div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-size: 12px;
}
.pet-stat b {
  font-size: 10px;
  font-weight: 400;
  color: #927969;
}
.pet-stat meter {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 9px;
  border: 0;
  background: #e7d8c2;
  border-radius: 6px;
  overflow: hidden;
}
.pet-stat meter::-webkit-meter-bar {
  background: #e7d8c2;
  border: 0;
  height: 8px;
}
.pet-stat meter::-webkit-meter-optimum-value {
  background: #d394a0;
}
.pet-stat:nth-child(2) meter::-webkit-meter-optimum-value {
  background: #d7ac66;
}
.pet-stat:nth-child(3) meter::-webkit-meter-optimum-value {
  background: #9cad81;
}
.pet-stat meter::-moz-meter-bar {
  background: #bd957e;
}
.room-cat {
  user-select: none;
  -webkit-user-select: none;
  position: absolute;
  width: clamp(250px, 27vw, 380px);
  aspect-ratio: 1;
  left: 50%;
  top: 61%;
  transform: translate(-50%, -50%);
  z-index: 1;
  touch-action: none;
}
.room-cat canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 7px #4c262344);
  transform-origin: 50% 77%;
  pointer-events: none;
}
.cat-thought {
  position: absolute;
  bottom: 82%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #fff8eaf2;
  border: 1px solid #c7ab8c;
  border-radius: 14px 14px 14px 2px;
  padding: 10px 17px;
  color: #795f50;
  font-size: 12px;
  box-shadow: 2px 3px 0 #4e342425;
}
.pet-spot {
  position: absolute;
  background: transparent;
  border-radius: 50%;
  padding: 0;
  touch-action: none;
}
.pet-spot:focus-visible {
  outline: 2px dashed #fff7de;
  outline-offset: 2px;
  background: #ffe7c533;
}
.pet-head {
  left: 4%;
  top: 30%;
  width: 50%;
  height: 39%;
}
.pet-belly {
  left: 55%;
  top: 44%;
  width: 27%;
  height: 36%;
}
.pet-paw {
  left: 8%;
  top: 70%;
  width: 43%;
  height: 17%;
}
.pet-tail {
  left: 83%;
  top: 50%;
  width: 16%;
  height: 29%;
}
.pet-hearts {
  position: absolute;
  left: 28%;
  top: 16%;
  opacity: 0;
  color: #fff2ed;
  text-shadow: 0 2px #b46a83;
  font-size: 32px;
  pointer-events: none;
}
.sleep-symbol {
  display: none;
  position: absolute;
  top: 21%;
  left: 30%;
  color: #fff7e5;
  text-shadow: 1px 2px #966647;
  font:
    italic 22px Georgia,
    serif;
  letter-spacing: 5px;
}
.room-cat[data-expression="sleepy"] .sleep-symbol {
  display: block;
}
.room-cat[data-reaction="belly"] canvas {
  animation: cat-roll 1.2s ease;
}
.room-cat[data-reaction="paw"] canvas {
  animation: cat-stretch 1.2s ease;
}
.room-cat[data-reaction="feed"] canvas {
  animation: cat-nuzzle 1.2s ease;
}
.room-cat:not([data-reaction="calm"]) .pet-hearts {
  animation: pet-love 1.2s ease-out forwards;
}
@keyframes cat-nuzzle {
  30% {
    transform: translateY(-7px) rotate(-3deg);
  }
  60% {
    transform: translateY(-2px) rotate(2deg);
  }
}
@keyframes cat-roll {
  35% {
    transform: rotate(-9deg) scale(1.04, 0.97);
  }
  70% {
    transform: rotate(4deg);
  }
}
@keyframes cat-stretch {
  40% {
    transform: scale(1.08, 0.94) translateY(3px);
  }
}
@keyframes pet-love {
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-42px) scale(1.12);
  }
}
.feed-cat {
  position: absolute;
  left: calc(50% + 205px);
  top: 68%;
  width: 148px;
  background: transparent;
  color: #fff1d7;
  text-shadow: 0 2px 2px #513620;
  padding: 0;
}
.feed-cat b,
.feed-cat small {
  display: block;
}
.feed-cat b {
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
}
.feed-cat small {
  font-size: 10px;
  margin-top: 5px;
}
.feed-cat:disabled {
  opacity: 1;
}
.food-bag {
  position: absolute;
  bottom: 69px;
  left: 80px;
  width: 44px;
  height: 57px;
  transform: rotate(8deg);
  border: 3px solid #886342;
  border-radius: 4px 4px 10px 10px;
  background: linear-gradient(
    #d3b98b 0 18%,
    #efdcad 18% 25%,
    #ab7750 25% 30%,
    #e8cfa6 30%
  );
  color: #ac6f64;
  text-shadow: none;
  padding-top: 20px;
  font-size: 21px;
  box-shadow: 2px 3px 0 #67462a55;
}
.food-bowl {
  display: block;
  position: relative;
  margin: 0 auto;
  width: 79px;
  height: 33px;
  border: 3px solid #725443;
  border-radius: 8px 8px 30px 30px;
  background: linear-gradient(#dc9f9c, #b7797e);
  box-shadow: 0 7px 5px #5a352838;
}
.food-bowl::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -12px;
  width: 81px;
  height: 24px;
  background: radial-gradient(
    ellipse,
    #684631 45%,
    #e9bbad 49% 66%,
    #825447 69%
  );
  border-radius: 50%;
}
.food-bowl i {
  position: absolute;
  z-index: 1;
  top: -6px;
  left: 20px;
  width: 7px;
  height: 5px;
  border-radius: 50%;
  background: #bc8644;
  box-shadow:
    13px 2px #b4813f,
    24px -1px #ce9a56,
    8px -5px #b9874a,
    31px 4px #c69a57;
}
.feed-cat[data-fed="true"] .food-bag,
.feed-cat[data-fed="true"] .food-bowl i {
  display: none;
}
.room-note {
  position: absolute;
  left: 28px;
  bottom: 65px;
  padding: 22px 24px;
  width: 290px;
  background: #fff5e5f2;
  box-shadow: 4px 5px 0 #53392538;
  border: 1px solid #dfc8aa;
  z-index: 3;
}
.room-note h3 {
  margin: 9px 0;
  font-size: 18px;
  font-weight: 500;
}
.room-note p {
  font-size: 11px;
  margin: 6px 0;
}
.room-note small {
  display: block;
  font-size: 10px;
  color: #9a7461;
  margin-top: 12px;
}
.room-note > button {
  position: absolute;
  right: 10px;
  top: 8px;
  background: transparent;
  font-size: 19px;
}
.room-footer {
  position: absolute;
  bottom: 22px;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  color: #fff0d8;
  font-size: 11px;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px #503421;
  pointer-events: none;
}

/* The board is a wood frame around a scrollable white writing surface. */
dialog.board-dialog {
  width: min(790px, calc(100vw - 28px));
  max-height: 94dvh;
  padding: 17px;
  background: repeating-linear-gradient(
    3deg,
    #926540 0 14px,
    #9b6d45 15px 17px,
    #946340 18px 37px
  );
  border: 5px solid #6b472e;
  box-shadow:
    inset 0 0 0 2px #c39462,
    0 30px 80px #172a2377;
}
.board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 19px;
  color: #fff1d5;
  text-shadow: 0 2px #62412e;
}
.board-top .overline {
  color: #e4c49c;
  font-size: 9px;
}
.board-top h2 {
  font-size: 29px;
  letter-spacing: 4px;
  font-weight: 500;
}
.board-top > button {
  background: #744b30;
  color: #ffe9cb;
  border: 1px solid #c39261;
  width: 34px;
  height: 34px;
  font-size: 23px;
}
.board-whiteboard {
  background: #fffcf1;
  border: 2px solid #664832;
  padding: 22px;
  box-shadow: inset 0 0 18px #b8964e20;
}
.board-tip {
  padding: 0 0 13px;
  border-bottom: 1px dashed #d7c6ac;
  font-size: 12px;
}
.board-meta {
  display: flex;
  gap: 12px;
  margin: 13px 0;
  color: #988675;
  font-size: 10px;
  align-items: center;
}
.board-meta button {
  background: transparent;
  text-decoration: underline;
  font-size: 10px;
  padding: 3px 0;
}
.board-meta span:last-child {
  margin-left: auto;
}
.board-posts {
  height: clamp(160px, 30dvh, 310px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 14px;
  padding: 8px 8px 15px;
  scrollbar-width: thin;
  scrollbar-color: #c5ab87 #f7efdd;
  background: repeating-linear-gradient(transparent 0 27px, #d7c6ac22 28px);
}
.board-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 38px 12px;
}
.board-empty span {
  display: block;
  font-size: 33px;
  color: #bf9174;
  margin-bottom: 9px;
}
.board-post {
  padding: 19px 17px 12px;
  background: #faf0cd;
  border: 1px solid #e8d9ad;
  box-shadow: 2px 3px 2px #68543917;
  position: relative;
  overflow-wrap: anywhere;
}
.board-post:nth-child(3n + 2) {
  background: #f9e8e4;
  border-color: #ecd7ce;
}
.board-post:nth-child(3n) {
  background: #edf0df;
  border-color: #dbe0c7;
}
.board-post::before {
  content: "";
  position: absolute;
  width: 36px;
  height: 10px;
  background: #d9cbae88;
  left: calc(50% - 18px);
  top: -5px;
  transform: rotate(-4deg);
}
.board-post p {
  color: #6d5947;
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 13px;
}
.board-post footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
  font-size: 10px;
  color: #aa8c75;
}
.board-post footer span {
  margin-right: auto;
}
.board-post footer button {
  font-size: 10px;
  background: transparent;
  padding: 2px;
  text-decoration: underline;
}
.board-status {
  min-height: 22px;
  font-size: 11px;
  color: #ae6668;
  padding-top: 5px;
}
.board-account {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 12px;
  color: #967b66;
  font-size: 11px;
}
.board-account span {
  margin-right: auto;
}
.board-account button {
  background: transparent;
  color: #9e626a;
  font-size: 11px;
  padding: 4px;
  text-decoration: underline;
}
#board-message {
  resize: vertical;
  width: 100%;
  min-height: 65px;
  max-height: 120px;
  border: 1px solid #d8c6aa;
  background: #fffdf6;
  padding: 12px;
  color: #66513f;
  font-size: 12px;
  border-radius: 3px;
}
.board-compose {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 10px;
  font-size: 11px;
}
.board-compose label {
  display: flex;
  align-items: center;
  gap: 5px;
}
.board-compose small {
  color: #aa967f;
}
.board-compose > button {
  margin-left: auto;
  padding: 10px 17px;
}
.account-dialog {
  max-width: 440px;
}
.account-dialog > h2 {
  margin: 14px 0 6px;
}
.account-tabs {
  display: flex;
  gap: 6px;
  margin: 22px 0 18px;
  border-bottom: 1px solid #d9c8ae;
  padding-bottom: 8px;
}
.account-tabs button {
  flex: 1;
  font-size: 12px;
  background: transparent;
  padding: 10px 5px;
  color: #947a65;
}
.account-tabs [aria-pressed="true"] {
  color: #a65e6d;
  background: #ecd4cc66;
  border-bottom: 2px solid #ba8490;
}
#account-form > label {
  display: block;
  font-size: 12px;
  margin: 13px 0;
}
#account-form input {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 7px;
  border: 1px solid #d7c4a8;
  border-radius: 3px;
  background: #fffaf0;
  color: #65513f;
  font-size: 13px;
}
.account-notice {
  font-size: 10px;
}
#account-status {
  min-height: 27px;
  color: #ac5861;
  font-size: 12px;
}
.guide-list {
  padding: 0;
  list-style: none;
  counter-reset: guide;
}
.guide-list li {
  counter-increment: guide;
  padding: 18px 0 18px 39px;
  border-bottom: 1px dashed #dccbb4;
  position: relative;
}
.guide-list li::before {
  content: counter(guide, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 20px;
  color: #b38b79;
  font:
    14px Georgia,
    serif;
}
.guide-list b {
  font-size: 14px;
  font-weight: 500;
}
.guide-list p {
  margin-top: 7px;
  font-size: 12px;
}
@media (max-width: 1000px) {
  .room-note {
    width: 235px;
    padding: 17px;
    bottom: 62px;
  }
  .room-note h3 {
    font-size: 16px;
  }
  .room-note p {
    font-size: 10px;
  }
  .feed-cat {
    left: calc(50% + 125px);
    top: 71%;
  }
}
@media (max-width: 700px) {
  .place-shortcuts {
    display: flex;
  }
  .guide-open {
    right: 20px;
    bottom: 87px;
    font-size: 11px;
    padding: 7px 10px;
  }
  .room-header {
    inset: 17px 15px auto;
    gap: 8px;
  }
  .room-back {
    font-size: 11px;
    padding: 10px;
    white-space: nowrap;
  }
  .room-name {
    padding-top: 53px;
    margin-left: -75px;
    margin-right: -40px;
    pointer-events: none;
  }
  .room-name h2 {
    font-size: 25px;
  }
  .room-name .overline {
    font-size: 7px;
  }
  .room-name p {
    font-size: 10px;
  }
  .room-help {
    width: 34px;
    height: 34px;
  }
  .pet-status {
    top: 164px;
    width: calc(100% - 28px);
    gap: 7px;
  }
  .pet-stat {
    padding: 10px;
  }
  .pet-stat div {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .pet-stat div > span {
    font-size: 11px;
  }
  .pet-stat b {
    font-size: 10px;
  }
  .room-cat {
    width: 270px;
    top: 55%;
  }
  .cat-thought {
    font-size: 11px;
    padding: 9px 12px;
  }
  .feed-cat {
    left: auto;
    right: 27px;
    top: 72%;
    width: 125px;
  }
  .room-note {
    left: 15px;
    right: 15px;
    width: auto;
    bottom: 58px;
    padding: 14px 19px;
  }
  .room-note p {
    font-size: 11px;
  }
  .room-note small {
    margin-top: 7px;
  }
  .room-note h3 {
    margin: 7px 0;
  }
  .room-footer {
    left: 16px;
    right: 16px;
    bottom: 18px;
    gap: 6px;
    font-size: 9px;
    flex-direction: column;
  }
  .board-dialog {
    padding: 9px;
  }
  .board-whiteboard {
    padding: 14px;
  }
  .board-top {
    padding: 7px 7px 13px;
  }
  .board-top h2 {
    font-size: 26px;
  }
  .board-posts {
    grid-template-columns: 1fr;
    height: 28dvh;
  }
  .board-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
  .board-compose {
    gap: 6px;
  }
  .board-compose > button {
    padding: 10px;
    font-size: 12px;
  }
  .board-compose small {
    font-size: 9px;
  }
}
@media (max-height: 650px) and (min-width: 701px) {
  .room-name p {
    display: none;
  }
  .room-header {
    top: 14px;
  }
  .pet-status {
    top: 100px;
  }
  .room-note {
    bottom: 50px;
    padding: 14px;
  }
  .room-cat {
    width: 260px;
    top: 62%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cottage-leaf,
  .cottage-glow {
    transition: none;
  }
  .room-cat canvas,
  .room-cat .pet-hearts {
    animation: none !important;
  }
}
