* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #7fd3f0;
  font-family: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  touch-action: none;
}
canvas {
  display: block;
  position: fixed;
  inset: 0;
}
.hidden {
  display: none !important;
}
#top {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
}
.pill {
  background: #fff;
  border: 3px solid #ff8cc6;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 18px;
  color: #c2427f;
  box-shadow: 0 3px 0 #e56aa8;
}
#bottom {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 14px;
  z-index: 5;
}
#bottom button {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  border: 3px solid #ff8cc6;
  background: #fff;
  font-size: 30px;
  box-shadow: 0 4px 0 #e56aa8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #c2427f;
}
#bottom button span {
  font-size: 13px;
  font-weight: 800;
  margin-top: 2px;
}
#bottom button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #e56aa8;
}
#toast {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #c2427f;
  border: 3px solid #ff8cc6;
  border-radius: 18px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 17px;
  text-align: center;
  max-width: 88vw;
  z-index: 20;
  box-shadow: 0 4px 0 #e56aa8;
  transition: opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
}
#modal {
  position: fixed;
  inset: 0;
  background: rgba(120, 40, 80, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 14px;
}
.card {
  background: #fff7fb;
  border: 4px solid #ff8cc6;
  border-radius: 26px;
  width: min(440px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 18px;
  box-shadow: 0 6px 0 #e56aa8;
  color: #7a2a55;
}
.card h2 {
  margin: 0 0 10px;
  text-align: center;
  color: #d94b90;
  font-size: 24px;
}
.btn {
  border: 3px solid #ff8cc6;
  background: #ff9fcf;
  color: #fff;
  font-weight: 900;
  font-size: 17px;
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 3px 0 #e56aa8;
  font-family: inherit;
}
.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #e56aa8;
}
.btn.white {
  background: #fff;
  color: #d94b90;
}
.btn:disabled {
  opacity: 0.45;
}
.row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
/* a dialog's closing buttons stay pinned to the bottom while long lists scroll (#3) */
.card > .row:last-child {
  position: sticky;
  bottom: -18px;
  z-index: 1;
  margin: 12px -18px -18px;
  padding: 12px 18px 18px;
  background: linear-gradient(rgba(255, 247, 251, 0), #fff7fb 12px);
}
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}
.tabs .btn {
  padding: 8px 12px;
  font-size: 15px;
}
.tabs .btn.off {
  background: #fff;
  color: #d94b90;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.cell {
  background: #fff;
  border: 3px solid #ffd0e6;
  border-radius: 16px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  position: relative;
}
.cell small {
  font-size: 11px;
  font-weight: 800;
  color: #b0487c;
  text-align: center;
  line-height: 1.1;
  padding: 0 2px;
}
.cell .cnt {
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 13px;
  font-weight: 900;
  color: #d94b90;
}
.cell.unk {
  background: #f4e6ee;
  color: #caa;
  font-size: 26px;
  font-weight: 900;
}
.list .li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 3px solid #ffd0e6;
  border-radius: 16px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.li .e {
  font-size: 30px;
}
.li .craftcv {
  width: 96px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(#e8f7ff, #bfe8fb);
}
.li .t {
  flex: 1;
  font-weight: 800;
}
.li .t small {
  display: block;
  font-weight: 700;
  color: #b0487c;
}
.li .btn {
  padding: 6px 10px;
  font-size: 14px;
}
input.name {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  border: 3px solid #ff8cc6;
  border-radius: 16px;
  padding: 10px;
  width: 100%;
  color: #c2427f;
  font-family: inherit;
}
#talk {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(100px + env(safe-area-inset-bottom));
  z-index: 25;
  background: #fff;
  border: 4px solid #ff8cc6;
  border-radius: 24px;
  padding: 14px 16px;
  box-shadow: 0 5px 0 #e56aa8;
  color: #7a2a55;
  max-width: 520px;
  margin: 0 auto;
}
#talk .tn {
  position: absolute;
  top: -18px;
  left: 18px;
  background: #ff8cc6;
  color: #fff;
  border-radius: 999px;
  padding: 3px 14px;
  font-weight: 900;
  font-size: 16px;
}
#talk .tt {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
  min-height: 44px;
}
#talk .th {
  font-size: 15px;
  margin-top: 6px;
}
#fish {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(40, 110, 160, 0.35);
}
#fwater {
  width: min(360px, 86vw);
  height: 230px;
  border-radius: 30px;
  background: radial-gradient(circle at 50% 50%, #9fe3ff, #4db6e6);
  border: 4px solid #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15);
}
#bobber {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 40px;
  transform: translate(-50%, -50%);
  transition: transform 0.15s;
}
#ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  transform: translate(-50%, -10%);
  animation: rip 1.6s infinite;
}
@keyframes rip {
  0% {
    width: 30px;
    height: 10px;
    opacity: 1;
  }
  100% {
    width: 140px;
    height: 50px;
    opacity: 0;
  }
}
#fmsg {
  margin-top: 14px;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 #2b7fb0;
  text-align: center;
  padding: 0 10px;
}
#fish .btn {
  margin-top: 14px;
}
#fbtn {
  font-size: 24px;
  padding: 14px 30px;
}
#fbtn.bite {
  animation: pulse 0.3s infinite alternate;
  background: #ff5fa8;
}
@keyframes pulse {
  to {
    transform: scale(1.12);
  }
}
#house {
  position: fixed;
  inset: 0;
  z-index: 27;
  background: #ffe3ef;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 10px 10px;
}
#house h2 {
  color: #d94b90;
  margin: 6px 0 4px;
}
#house .hint {
  color: #b0487c;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  text-align: center;
}
#room {
  width: min(420px, 94vw);
  border: 6px solid #e882b4;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}
#wall {
  height: 60px;
  background: repeating-linear-gradient(90deg, #ffc0dc 0 18px, #ffd6e8 18px 36px);
  border-bottom: 6px solid #d9709f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
#floor {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: repeating-conic-gradient(#fff1f7 0 25%, #ffdcec 0 50%) 0 0/25% 33.33%;
}
#floor .slot {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  border: 1px dashed rgba(217, 112, 159, 0.25);
}
/* ----- rooms and the backyard (js/home.js) ----- */
#htabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 0 6px;
  max-width: min(440px, 96vw);
}
#htabs button {
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  color: #b0487c;
  background: #fff;
  border: 3px solid #ffc0dc;
  border-radius: 14px;
  padding: 5px 9px;
}
#htabs button.on {
  background: #ff8cc6;
  border-color: #e56aa8;
  color: #fff;
}
#htabs button.locked {
  opacity: 0.7;
  border-style: dashed;
}
.wallbtn {
  font: inherit;
  font-weight: 900;
  font-size: 16px;
  color: #b0487c;
  background: #fff;
  border: 3px solid #ff8cc6;
  border-radius: 16px;
  padding: 6px 12px;
  margin: 0 12px;
  box-shadow: 0 3px 0 #e56aa8;
}
#room {
  transition: filter 0.6s;
}
#room.r-bed #wall {
  background: repeating-linear-gradient(90deg, #d8cdfb 0 18px, #e6defd 18px 36px);
  border-bottom-color: #a18fdc;
}
#room.r-bed #floor {
  background: repeating-conic-gradient(#f3efff 0 25%, #e4dcff 0 50%) 0 0/25% 33.33%;
}
#room.r-kitchen #wall {
  background: repeating-linear-gradient(90deg, #fff4c9 0 18px, #fffae3 18px 36px);
  border-bottom-color: #e8c25a;
}
#room.r-kitchen #floor {
  background: repeating-conic-gradient(#ffffff 0 25%, #e9f6ff 0 50%) 0 0/20% 25%;
}
#room.r-yard {
  border-color: #7fcf8a;
}
#room.r-yard #wall {
  background: linear-gradient(#9fdcff, #d4f1ff);
  border-bottom: 10px solid;
  border-image: repeating-linear-gradient(90deg, #fff 0 10px, #e9d6c0 10px 14px) 10;
}
#room.r-yard #floor {
  background: repeating-linear-gradient(135deg, #9fe3a0 0 22px, #aeeaae 22px 44px);
}
#room.r-yard .slot {
  border-color: rgba(60, 140, 70, 0.18);
}
#room.editing .slot > * {
  display: inline-block;
  animation: jiggle 0.35s infinite alternate;
}
@keyframes jiggle {
  from {
    transform: rotate(-4deg);
  }
  to {
    transform: rotate(4deg);
  }
}
#room.napping,
#room.starry {
  filter: brightness(0.45) saturate(0.7);
}
#floor .slot {
  position: relative;
}
.slot .puff {
  position: absolute;
  bottom: 40%;
  font-size: 18px;
  pointer-events: none;
  animation: puff 1.2s ease-out forwards;
}
@keyframes puff {
  from {
    opacity: 1;
    transform: translateY(0) scale(0.6);
  }
  to {
    opacity: 0;
    transform: translateY(-70px) scale(1.2);
  }
}
.slot.a-wiggle > :first-child {
  animation: a-wiggle 0.5s 2;
}
.slot.a-bounce > :first-child {
  animation: a-bounce 0.45s 2;
}
.slot.a-spin > :first-child {
  animation: a-spin 0.9s;
}
.slot.a-float > :first-child {
  animation: a-float 1s;
}
.slot.a-zoom > :first-child {
  animation: a-zoom 0.9s;
}
@keyframes a-wiggle {
  25% {
    transform: rotate(-12deg);
  }
  75% {
    transform: rotate(12deg);
  }
}
@keyframes a-bounce {
  50% {
    transform: translateY(-14px) scale(1.1, 0.92);
  }
}
@keyframes a-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes a-float {
  50% {
    transform: translateY(-22px);
  }
}
@keyframes a-zoom {
  40% {
    transform: translateX(26px) rotate(10deg);
  }
  70% {
    transform: translateX(-16px);
  }
}
.need span {
  display: inline-block;
  margin-right: 4px;
}
.need .miss {
  opacity: 0.45;
}
/* ----- the mailbox (js/mail.js) ----- */
.list .li.new {
  border-color: #ff8cc6;
  background: #fff4fa;
}
.list .li[onclick] {
  cursor: pointer;
}
.stks {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.stks button,
.notes button {
  font: inherit;
  background: #fff;
  border: 3px solid #ffd0e6;
  border-radius: 14px;
}
.stks button {
  font-size: 22px;
  padding: 2px 0;
}
.notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.notes button {
  font-weight: 800;
  font-size: 12.5px;
  line-height: 1.2;
  color: #b0487c;
  padding: 5px 4px;
}
.stks button.on,
.notes button.on,
.grid .cell.on {
  border-color: #ff5fa8;
  background: #ffe3ef;
  box-shadow: 0 0 0 2px #ff8cc6;
}
.letter {
  position: relative;
  background: repeating-linear-gradient(#fffdf6 0 30px, #f3e3d3 30px 31px);
  border: 3px solid #f2c9a8;
  border-radius: 14px;
  padding: 14px 18px 12px;
  font-weight: 800;
  color: #7a3b5a;
  font-size: 17px;
}
.letter p {
  margin: 4px 0 8px;
}
.letter .note {
  font-size: 21px;
  color: #d94b90;
  text-align: center;
}
.letter .sig {
  text-align: right;
}
.letter .stk {
  position: absolute;
  top: -16px;
  right: -8px;
  font-size: 44px;
  transform: rotate(12deg);
}
.letter .gift {
  text-align: center;
  font-size: 48px;
  line-height: 1.1;
}
.letter .gift small {
  display: block;
  font-size: 14px;
}
#score {
  margin-top: 10px;
  font-weight: 900;
  color: #d94b90;
  font-size: 18px;
}
#mppill {
  position: fixed;
  top: calc(58px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  font-size: 15px;
  padding: 5px 12px;
  white-space: nowrap;
  pointer-events: auto;
  max-width: 94vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.mp #toast {
  top: calc(104px + env(safe-area-inset-top));
}
#emobar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(96px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 24;
}
#emobar button {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 3px solid #ff8cc6;
  background: #fff;
  font-size: 30px;
  box-shadow: 0 3px 0 #e56aa8;
  padding: 0;
  font-family: inherit;
}
#emobar button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #e56aa8;
}
.code {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 8px;
  text-align: center;
  color: #d94b90;
  background: #fff;
  border: 4px dashed #ff8cc6;
  border-radius: 20px;
  padding: 6px 0 6px 8px;
  margin: 6px 0;
  font-family: inherit;
}
input.code {
  width: 100%;
  text-transform: uppercase;
  outline: none;
}
input.code::placeholder {
  color: #f3c2da;
}
.big {
  display: block;
  width: 100%;
  font-size: 21px;
  padding: 14px;
  margin-top: 10px;
}
.sws {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}
.sw {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px #ffd0e6;
  padding: 0;
}
.sw.on {
  box-shadow: 0 0 0 4px #d94b90;
}
.dot {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #ffd0e6;
}
.note {
  background: #fff;
  border: 3px dashed #ffd0e6;
  border-radius: 16px;
  padding: 10px;
  text-align: center;
  font-weight: 700;
  margin-top: 10px;
}
.card h3 {
  margin: 14px 0 6px;
  color: #d94b90;
  text-align: center;
}
.card p.c {
  text-align: center;
  font-weight: 700;
}
.fly {
  animation: fly 1.2s ease-in-out infinite alternate;
}
@keyframes fly {
  from {
    transform: translate(-20px, 6px) rotate(-6deg);
  }
  to {
    transform: translate(20px, -6px) rotate(6deg);
  }
}
#gear {
  position: fixed;
  top: calc(62px + env(safe-area-inset-top));
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 3px solid #ffd0e6;
  font-size: 19px;
  z-index: 6;
  padding: 0;
  color: #c2427f;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  transition:
    background 1.5s linear,
    transform 0.2s;
}
#who {
  position: fixed;
  top: calc(62px + env(safe-area-inset-top));
  left: 10px;
  height: 40px;
  max-width: 46vw;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 3px solid #ffd0e6;
  font-size: 15px;
  font-weight: 800;
  z-index: 6;
  padding: 0 12px 0 6px;
  color: #c2427f;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
}
#who:before {
  content: '👥';
  margin-right: 4px;
}
#who .dot {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}
#who:active {
  transform: scale(0.95);
}
.plist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 10px;
}
.plist .li {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 3px solid #ffd0e6;
  border-radius: 16px;
  padding: 8px 10px;
}
.plb {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  border: 3px solid #ff8cc6;
  background: #fff;
  border-radius: 18px;
  padding: 10px 14px;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  color: #c2427f;
  box-shadow: 0 3px 0 #e56aa8;
}
.plb small {
  margin-left: auto;
  font-size: 13px;
  color: #b0487c;
}
.plb.now {
  background: #ffe6f1;
  box-shadow: none;
  opacity: 1;
}
.plb:active {
  transform: translateY(2px);
}
.pwg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 4px;
}
.pwg.all {
  grid-template-columns: repeat(5, 1fr);
}
.pwg.off {
  opacity: 0.4;
  pointer-events: none;
}
.pwe {
  aspect-ratio: 1;
  border: 3px solid #ffd0e6;
  background: #fff;
  border-radius: 18px;
  font-size: 34px;
  padding: 0;
  box-shadow: 0 3px 0 #f3b5d3;
  font-family: inherit;
}
.pwg.all .pwe {
  font-size: 28px;
  border-radius: 14px;
}
.pwe:active {
  transform: scale(0.9);
  background: #ffe6f1;
}
.pwg.shake {
  animation: pwnudge 0.4s ease 1;
}
@keyframes pwnudge {
  25% {
    transform: translateX(-7px);
  }
  75% {
    transform: translateX(7px);
  }
}
#gear.hold {
  background: #ff8cc6;
  transform: scale(1.15);
}
textarea.bk {
  width: 100%;
  height: 80px;
  border: 3px solid #ffd0e6;
  border-radius: 14px;
  padding: 8px;
  font-size: 12px;
  font-family: monospace;
  color: #7a2a55;
  user-select: text;
  -webkit-user-select: text;
}
.card label.btn {
  display: inline-block;
  cursor: pointer;
}
#toast {
  z-index: 29;
}
body.inmus #toast {
  top: auto;
  bottom: calc(96px + env(safe-area-inset-bottom));
}
.tabs {
  flex-wrap: wrap;
}
.ei {
  display: inline-block;
  line-height: 1;
}
.frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  border: 3px solid #d9a93c;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px #fff3c4,
    0 2px 0 rgba(0, 0, 0, 0.18);
  line-height: 1;
}
.frame .ei {
  font-size: 0.68em;
}
.svgi {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: middle;
}
.svgi svg {
  width: 100%;
  height: 100%;
  display: block;
}
.sil {
  filter: brightness(0) opacity(0.2);
}
.cell .mus {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 12px;
}
.cell .when {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 11px;
}
.cell.on {
  border-color: #d94b90;
  box-shadow: 0 0 0 3px #ff8cc6;
}
#card canvas {
  position: static;
  inset: auto;
  display: block;
}
#mirc {
  width: 200px;
  height: 150px;
  margin: 0 auto;
  background: radial-gradient(#fff, #ffe3ef);
  border-radius: 20px;
  border: 3px solid #ffd0e6;
}
canvas.accc {
  width: 64px;
  height: 52px;
  margin: 0 auto;
}
.accg {
  grid-template-columns: repeat(3, 1fr);
}
.accg .cell {
  aspect-ratio: auto;
  padding: 4px 2px 6px;
  min-height: 92px;
  justify-content: flex-start;
}
.accg .cell small {
  font-size: 10px;
}
.locked canvas.accc {
  filter: brightness(0) opacity(0.2);
}
.rw {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 4px 0;
}
.rw .cell {
  width: 96px;
  font-size: 34px;
}
.rw canvas.accc {
  width: 72px;
  height: 58px;
}
#mirbtn {
  font-size: 28px;
  background: #fff;
  border: 3px solid #ff8cc6;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  padding: 0;
  box-shadow: 0 3px 0 #e56aa8;
  margin: 0 14px;
  vertical-align: middle;
}
#museum {
  position: fixed;
  inset: 0;
  z-index: 27;
  background: linear-gradient(#fff6ea, #ffe3ef);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 8px calc(12px + env(safe-area-inset-bottom));
  overflow: auto;
  color: #7a2a55;
}
#museum > * {
  width: min(440px, 100%);
  flex-shrink: 0;
}
.mtop {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.npc svg {
  width: 76px;
  height: 84px;
  display: block;
}
.npc .npce {
  display: flex;
  width: 76px;
  height: 84px;
  align-items: center;
  justify-content: center;
  font-size: 58px;
  background: radial-gradient(circle at 50% 62%, #fff 0 34px, transparent 35px);
  animation: npcbob 2.4s ease-in-out infinite;
}
@keyframes npcbob {
  50% {
    transform: translateY(-3px);
  }
}
.say {
  flex: 1;
  position: relative;
  background: #fff;
  border: 3px solid #ff8cc6;
  border-radius: 18px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 15px;
  min-height: 62px;
  margin-bottom: 8px;
  box-shadow: 0 3px 0 #e56aa8;
  line-height: 1.3;
}
.say b:first-child {
  display: block;
  color: #d94b90;
  font-size: 13px;
}
.say:before {
  content: '';
  position: absolute;
  left: -14px;
  bottom: 16px;
  border: 7px solid transparent;
  border-right-color: #ff8cc6;
}
.mt {
  margin: 6px 0 8px;
  gap: 5px;
}
.mt .btn {
  padding: 3px 6px;
  font-size: 19px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 54px;
  line-height: 1.1;
}
.mt .btn small {
  font-size: 10px;
}
.wing {
  border-radius: 18px;
  padding: 8px;
  border: 4px solid #e7c6da;
  background: #fffaf2;
}
.wt {
  text-align: center;
  font-weight: 900;
  color: #d94b90;
  margin-bottom: 6px;
}
.wt span {
  font-size: 13px;
  color: #b0487c;
}
.cases {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.case {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  background: #fff;
  border: 2px solid #f1d6e6;
  overflow: hidden;
}
.case small {
  font-size: 8.5px;
  font-weight: 800;
  text-align: center;
  line-height: 1;
  color: #7a2a55;
  padding: 0 1px;
  max-height: 18px;
  overflow: hidden;
  margin-top: 2px;
}
.case .q {
  position: absolute;
  top: 1px;
  right: 4px;
  font-size: 11px;
  color: #b98aa5;
}
.case.new {
  animation: pop 0.6s ease 3;
}
@keyframes pop {
  50% {
    transform: scale(1.22);
  }
}
.w-fish .case {
  background: linear-gradient(#c8f3ff, #5fbde6);
  border-color: #8fd3f0;
}
.w-fish .case:after {
  content: '';
  position: absolute;
  left: 18%;
  bottom: 10%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  animation: bub 2.6s linear infinite;
}
.w-fish .case:nth-child(3n):after {
  left: 72%;
  animation-delay: 1.1s;
}
@keyframes bub {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-40px);
    opacity: 0;
  }
}
.w-sea .case {
  background: linear-gradient(#d4fff5, #72d6c4);
  border-color: #8fe0cf;
}
.w-bug .case {
  background: linear-gradient(#f4ffe9, #c5ebad);
  border-color: #b6e39a;
}
.w-fossil .case {
  background: linear-gradient(#fffaf0, #e6d3b8);
  border-color: #dcc5a5;
}
.w-art .cases {
  grid-template-columns: repeat(4, 1fr);
}
.w-art .case {
  font-size: 36px;
  background: #fff4f8;
}
.mnote {
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  margin: 8px 0 0;
}
/* the museum's buttons stay pinned to the bottom while the cases scroll (#3) */
.mbtns {
  position: sticky;
  bottom: calc(-12px - env(safe-area-inset-bottom));
  z-index: 1;
  margin: 10px 0 calc(-12px - env(safe-area-inset-bottom));
  padding: 10px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(255, 227, 239, 0), #ffe3ef 12px);
}
.cafe {
  background: repeating-linear-gradient(90deg, #fff3e8 0 22px, #ffe8d6 22px 44px);
  border: 4px solid #e7b99a;
  border-radius: 18px;
  padding: 8px;
}
.cafe .li {
  margin-bottom: 6px;
  padding: 5px 8px;
}
.drink {
  position: relative;
  font-size: 30px;
  width: 42px;
  text-align: center;
}
.drink .dx {
  position: absolute;
  right: -2px;
  bottom: -5px;
  font-size: 15px;
}
.mnote .drink {
  display: inline-block;
  font-size: 20px;
  width: 26px;
}
.stampcard {
  background: #fff;
  border: 3px dashed #ff8cc6;
  border-radius: 14px;
  padding: 8px;
  text-align: center;
  margin-top: 8px;
}
.stamps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 6px 0;
}
.stamps span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #ffd0e6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #f3c2da;
  font-size: 15px;
}
.stamps span.on {
  background: #ffe3ef;
  border-color: #ff8cc6;
  font-size: 20px;
}
.tables {
  display: flex;
  justify-content: space-around;
  margin-top: 8px;
}
.tbl {
  position: relative;
  width: 88px;
  height: 82px;
}
.tbl .guest {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-size: 40px;
}
.tbl .guest.empty {
  font-size: 24px;
  top: 20px;
  opacity: 0.55;
}
.tbl:after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 22px;
  border-radius: 50%;
  background: #ffb3d6;
  box-shadow: 0 5px 0 #e56aa8;
}
.tbl .top {
  position: absolute;
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  font-size: 16px;
  z-index: 1;
}
.confetti {
  position: relative;
  height: 0;
}
.confetti i {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: conf 1.7s ease-in forwards;
}
@keyframes conf {
  from {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
  to {
    transform: translateY(280px) rotate(540deg);
    opacity: 0;
  }
}
.card .npc svg {
  width: 64px;
  height: 70px;
}
/* emote picker (😊 My emotes) */
#emobar button.edit {
  font-size: 22px;
  background: #ffe6f1;
}
.emoslots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 8px 0 12px;
}
.emoslots button,
.emopool button {
  aspect-ratio: 1;
  border: 3px solid #ffd0e6;
  background: #fff;
  border-radius: 14px;
  font-size: 26px;
  padding: 0;
  font-family: inherit;
}
.emoslots button.on {
  border-color: #ff5fa2;
  background: #ffe6f1;
  box-shadow: 0 0 0 3px #ffb3d9;
}
.emopool {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.emopool button.used {
  background: #ffe6f1;
  opacity: 0.55;
}
.emoslots button:active,
.emopool button:active {
  transform: scale(0.92);
}
/* best friends chat */
body.chatting #bottom {
  gap: 8px;
}
body.chatting #bottom button {
  width: 62px;
  height: 68px;
  font-size: 26px;
}
#bChat {
  position: relative;
}
#bChat .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  background: #ff5f73;
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  padding: 0 5px;
  border: 2px solid #fff;
}
#chat {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  max-width: 440px;
  margin: 0 auto;
  background: #fff7fb;
  border: 3px solid #ff8cc6;
  border-radius: 20px;
  box-shadow: 0 4px 0 #e56aa8;
  padding: 8px 10px 6px;
  z-index: 24;
  color: #7a2a55;
}
#chat .chathead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 900;
  color: #d94b90;
}
#chatx {
  border: none;
  background: none;
  font-size: 18px;
  color: #d94b90;
  padding: 2px 6px;
  font-family: inherit;
}
#chatlog {
  max-height: 28vh;
  overflow-y: auto;
  margin: 6px 0;
  font-size: 15px;
  line-height: 1.35;
  user-select: text;
  -webkit-user-select: text;
}
#chatlog .cl {
  padding: 3px 0;
  overflow-wrap: anywhere;
}
#chatlog .cl.me b {
  color: #d94b90;
}
#chatlog .dot {
  width: 12px;
  height: 12px;
  margin-right: 4px;
}
#chatlog p.c {
  margin: 8px 0;
}
#chat .chatrow {
  display: flex;
  gap: 6px;
}
#chatin {
  flex: 1;
  min-width: 0;
  font-size: 16px; /* 16px+ stops phones zooming in on focus */
  font-weight: 700;
  border: 3px solid #ffd0e6;
  border-radius: 14px;
  padding: 8px 10px;
  color: #7a2a55;
  font-family: inherit;
  user-select: text;
  -webkit-user-select: text;
}
#chat .btn {
  padding: 8px 14px;
}
#chatnote {
  margin: 4px 0 0;
  min-height: 1em;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
/* "Leave Capy Island?" when back is pressed (#4): above everything, even the passcode gate */
#quit {
  position: fixed;
  inset: 0;
  background: rgba(120, 40, 80, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 14px;
}
/* welcome: name box + 🎲 for another fun name (#6) */
.nmrow {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.nmrow input.name {
  flex: 1;
  min-width: 0;
}
.nmrow .btn {
  font-size: 26px;
  padding: 0 12px;
}
/* looking around a best friend's house (#5): no mirror, nothing to move */
#house.guest #mirbtn,
#house.guest .mirror {
  display: none;
}
/* "Player from another phone" steps */
.steps {
  margin: 4px 0 10px;
  padding-left: 22px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}
.steps li {
  margin: 4px 0;
}
/* keyboard open (see chatKeyboard): sit just above it, with a shorter log so it all fits */
body.kb #chat {
  bottom: calc(var(--kb) + 8px);
}
body.kb #chatlog {
  max-height: max(44px, min(28vh, calc(var(--vvh) - 150px)));
}
/* fishing rod and line (drawn by fishDraw) */
#rod {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
#rodline {
  fill: none;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 1.6;
}
#rodpole {
  fill: none;
  stroke: #b7794a;
  stroke-width: 6;
  stroke-linecap: round;
}
#rodhandle {
  fill: none;
  stroke: #ff8cc6;
  stroke-width: 11;
  stroke-linecap: round;
}
#rodreel {
  fill: #fff;
  stroke: #d94b90;
  stroke-width: 3;
}
#bobber {
  z-index: 2;
}
/* casting: the bobber flies in an arc from the rod tip (offset --cx/--cy) to the middle of the water */
#bobber.cast {
  animation: cast 0.45s ease-out;
}
@keyframes cast {
  from {
    transform: translate(calc(-50% + var(--cx)), calc(-50% + var(--cy))) scale(0.55);
  }
  45% {
    transform: translate(calc(-50% + var(--cx) * 0.45), calc(-50% + var(--cy) * 0.6 - 26px)) scale(0.8);
  }
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}
/* what's new splash */
.news {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
}
.news .nw {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff;
  border: 3px solid #ffd0e6;
  border-radius: 16px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.35;
}
.news .ne {
  font-size: 30px;
  line-height: 1;
  flex-shrink: 0;
}
.news b {
  display: block;
  color: #d94b90;
  font-size: 16px;
}
/* drawing board: painter and viewer */
.bcv {
  display: block;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 3;
  margin: 6px auto 8px;
  border: 5px solid #a8703f;
  border-radius: 10px;
  background: #fffaf2;
  image-rendering: pixelated;
  box-shadow: 0 3px 0 #7d4d2a;
}
.bcv.paint {
  touch-action: none;
  cursor: crosshair;
}
.bpal {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  max-width: 320px;
  margin: 0 auto 6px;
}
.bsw {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #ffd0e6;
  padding: 0;
  font-size: 16px;
}
.bsw.on {
  box-shadow: 0 0 0 3px #d94b90;
  transform: scale(1.12);
}
.btools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: 330px;
  margin: 0 auto;
}
.btools button {
  min-width: 40px;
  height: 40px;
  border: 3px solid #ffd0e6;
  border-radius: 12px;
  background: #fff;
  font-size: 19px;
  padding: 0 4px;
  font-family: inherit;
  font-weight: 900;
  color: #d94b90;
}
.btools button.on {
  border-color: #d94b90;
  background: #ffe6f1;
}
/* another tab is playing (js/save.js) */
#tabgone {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(90, 30, 70, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
/* moving to the new address: who couldn't come (js/move.js); above the passcode gate */
#movenote {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(90, 30, 70, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
/* flying between islands: the clouds part (js/clouds.js) */
#clouds {
  position: fixed;
  inset: 0;
  z-index: 28;
  overflow: hidden;
  pointer-events: none;
}
/* the sky behind the clouds clears first, then the clouds slide out to the sides */
#clouds::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(#bfe6ff, #eaf6ff);
  animation: fadeaway 0.8s 0.35s ease-in forwards;
}
#clouds.calm::before {
  background: #f4fbff;
  animation-duration: 0.6s;
  animation-delay: 0.1s;
}
@keyframes fadeaway {
  to {
    opacity: 0;
  }
}
.cpuff {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #ffffff 0 55%, #eef6ff 72%, #d7e8f7 100%);
  box-shadow: inset -1.2vmax -1.6vmax 0 rgba(190, 214, 236, 0.55);
  animation: cloudout 1.3s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}
@keyframes cloudout {
  75% {
    opacity: 1;
  }
  to {
    transform: translate(var(--dx), var(--dy)) scale(1.2);
    opacity: 0;
  }
}
.cplane {
  position: absolute;
  top: 46%;
  left: -15%;
  font-size: 56px;
  filter: drop-shadow(0 6px 4px rgba(60, 90, 130, 0.25));
  animation: planezoom 1.6s 0.35s ease-in-out forwards;
}
@keyframes planezoom {
  0% {
    transform: translate(0, 0) rotate(-6deg);
  }
  50% {
    transform: translate(65vw, -6vh) rotate(4deg);
  }
  100% {
    transform: translate(135vw, -14vh) rotate(-8deg);
  }
}
