@font-face {
  font-family: "Guimi Letter";
  src: url("/assets/fonts/guimi-letter.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --kv-forest: #214216;
  --kv-cypress: #345c20;
  --kv-lime: #d8e575;
  --kv-paper: #fff8e9;
  --kv-ink: #245234;
  --kv-writing: "Guimi Letter", "Kaiti SC", "STKaiti", KaiTi, serif;
  --kv-label: "PingFang SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --ink: var(--kv-ink);
  --moss: var(--kv-cypress);
  --paper: var(--kv-paper);
}

body { font-family: var(--kv-label); background-color: #142811; }

#app h1,
#app .gm-cloud-title,
#app .entry-letter h2,
#app .entry-salutation {
  font-family: var(--kv-writing);
}

#app header .brand {
  width: 104px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#app header .brand img { width: 100%; height: 100%; }

#game-stage #app header .header-action {
  min-height: 44px;
  padding: 6px 12px;
}

#game-stage #app header .back,
#game-stage #app .gm-screen-back {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  padding: 0 0 2px;
  line-height: 1;
}

#game-stage #app .gm-estimate-retry {
  min-height: 35px;
  padding: 5px 12px;
  border: 1px solid #74915b;
  border-radius: 12px;
  color: var(--kv-forest);
  background: var(--kv-paper);
}

#app .entry-home .entry-heading {
  top: 95px;
  left: 25px;
  right: 25px;
}

#app .entry-home .entry-number {
  margin: 0 0 3px;
  color: #38623e;
  font: 400 18px / 1.05 var(--kv-writing);
  letter-spacing: .12em;
  transform: rotate(-4deg);
}

#app .entry-home h1 {
  position: relative;
  isolation: isolate;
  margin: 0 auto;
  width: max-content;
  padding: 0 8px 5px;
  color: var(--kv-forest);
  font-size: 52px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: .035em;
  transform: rotate(-3deg);
}

#app .entry-home h1::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 3px -5px -2px;
  background: #fffaf0df;
  border-radius: 20% 45% 14% 28% / 45% 18% 33% 32%;
  transform: rotate(1deg);
}

#app .entry-home .entry-ribbon {
  position: relative;
  top: auto;
  left: auto;
  margin: 14px 0 0;
  padding: 3px 15px 5px;
  transform: rotate(-2deg);
  background: #f0d3b2;
  color: #553e2d;
  border: 0;
  border-radius: 28% 8% 28% 12% / 22% 20% 15% 34%;
  box-shadow: none;
  font: 400 16px / 1.2 var(--kv-writing);
  letter-spacing: .04em;
}

#app .entry-plane {
  position: absolute;
  z-index: 5;
  top: 230px;
  right: 28px;
  width: 51px;
  height: auto;
  transform: rotate(8deg);
  pointer-events: none;
}

#app .entry-home .entry-home-post {
  top: 522px;
  left: 285px;
  width: 78px;
  height: 97px;
}

#app .entry-home .entry-start {
  left: 43px;
  bottom: 68px;
  width: 304px;
  padding: 11px 16px 12px 23px;
  background: #fff1c3;
  border-color: #866e48;
  border-radius: 46% 48% 48% 43% / 72% 76% 68% 73%;
  color: #54412e;
  box-shadow: 0 4px 0 #526b34, 0 8px 15px #0b271d55;
  transform: rotate(-1deg);
  font: 400 20px / 1.25 var(--kv-writing);
}

#app .entry-start > span { font: inherit; }

#app .entry-intro .entry-intro-invitation {
  top: 89px;
}

#app .entry-intro h1 {
  color: var(--kv-forest);
  font-size: 31px;
  font-weight: 400;
}

#app .entry-intro .entry-intro-post,
#app.intro-open .entry-intro .entry-intro-post {
  left: 125px;
  top: 137px;
  width: 140px;
  height: 168px;
  transform: rotate(-4deg);
}

#app .entry-intro .entry-envelope {
  top: 342px;
  left: 25px;
  width: 340px;
  border: 0;
  border-radius: 14px;
  background: none;
  box-shadow: none;
}

#app.intro-closed .entry-intro .entry-envelope {
  transform-origin: center top;
  animation: postbox-introduction 800ms cubic-bezier(.22,.65,.3,1) both;
}

#app.intro-open .entry-intro .entry-envelope { top: 265px; }

#app .entry-intro .entry-envelope-back {
  border: 1px solid #4b6d3c;
  border-radius: 12px;
  background: #678c56;
  box-shadow: 0 10px 18px #1b3a2440;
}

#app .entry-intro .entry-envelope-flap {
  background: #b0c68b;
  border-radius: 10px;
}

#app.intro-open .entry-intro .entry-envelope-flap { height: 49px; }

#app .entry-intro .entry-envelope-front {
  background:
    linear-gradient(33deg, #557b49 49%, #b9cf8b 50% 51%, transparent 52%) left / 50% 100% no-repeat,
    linear-gradient(-33deg, #70975b 49%, #b9cf8b 50% 51%, transparent 52%) right / 50% 100% no-repeat;
  border-radius: 11px;
}

#app .entry-intro .entry-seal {
  border-color: #926a34;
  background: #f3ce79;
  color: #644927;
  box-shadow: 0 3px 0 #8d733a;
}

#game-stage #app .entry-envelope.has-receive-mail-art > .receive-mail-art-layer {
  position: absolute;
  inset: auto 8px 0;
  z-index: 3;
  aspect-ratio: 420 / 455;
  display: block;
  pointer-events: none;
}

#game-stage #app .entry-envelope.has-receive-mail-art .receive-mail-frame-closed {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1;
  object-fit: contain;
}

#app.intro-closed .entry-envelope.has-receive-mail-art .entry-envelope-back,
#app.intro-closed .entry-envelope.has-receive-mail-art .entry-envelope-flap,
#app.intro-closed .entry-envelope.has-receive-mail-art .entry-envelope-front,
#game-stage #app.intro-open .entry-envelope.has-receive-mail-art > .receive-mail-art-layer {
  display: none;
}

#app.intro-closed .entry-envelope.has-receive-mail-art .entry-seal {
  inset: 0;
  width: 100%;
  height: 100%;
  justify-content: end;
  padding-bottom: 17px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

#app.intro-closed .entry-envelope.has-receive-mail-art .entry-seal > span:first-child { display: none; }

#app.intro-closed .entry-envelope.has-receive-mail-art .entry-seal-action {
  padding: 4px 14px 6px;
  color: #54412e;
  border: 1px solid #678347;
  border-radius: 14px;
  background: #fff8df;
}

#app .entry-intro .entry-letter {
  border: 1px solid #829467;
  border-radius: 14px 10px 16px 8px;
  padding: 26px 23px 31px;
  color: var(--kv-ink);
  background: repeating-linear-gradient(0deg, transparent 0 6px, #806f4e0d 7px 8px), var(--kv-paper);
  box-shadow: inset 0 0 0 5px #f9ecd1;
}

#app .entry-intro .entry-salutation { font-size: 20px; color: #614a36; }
#app .entry-intro .entry-letter h2 { font-size: 23px; margin: 0 0 12px; color: var(--kv-forest); letter-spacing: 0; }
#app .entry-intro .entry-letter-copy { font: 400 16px / 1.82 var(--kv-writing); color: #584934; }
#app .entry-intro .entry-journey { margin: 19px 0 17px; padding: 13px 0; color: var(--kv-ink); }
#app .entry-intro .entry-journey b { font: 400 14px / 1.1 var(--kv-writing); }

#app .entry-intro .entry-write {
  border-color: #345c35;
  border-radius: 24px 23px 25px 20px;
  background: #416d40;
  color: #fffbed;
  box-shadow: 0 4px 0 #284b2d;
  font: 400 19px / 1.2 var(--kv-writing);
}

#app .entry-intro .entry-intro-messenger,
#app.intro-open .entry-intro .entry-intro-messenger {
  top: 566px;
  right: 8px;
  width: 122px;
  height: 130px;
}

#app.intro-open .entry-intro .entry-intro-messenger {
  top: 674px;
  width: 99px;
  height: 105px;
}

#app .receive-page .read-body,
#app .gm-letter-paper textarea { font-family: var(--kv-writing); }
#app .gm-wardrobe .wr-nav h1 { font-family: var(--kv-writing); }

#game-stage #app .gm-compose .gm-cloud-title {
  font-size: 24px;
  color: var(--kv-forest);
  font-weight: 400;
}

#game-stage #app .gm-compose #letter-form {
  border: 1px solid #83916c;
  border-radius: 13px 16px 12px 15px;
  background:
    linear-gradient(115deg, #fcf5e425, #edddaa41),
    repeating-linear-gradient(0deg, #fff8e9 0, #fff8e9 6px, #f9eed7 7px, #fff8e9 8px);
  box-shadow: 0 0 0 4px #e2ddb98c, 3px 6px 0 #536b393d;
  max-height: 550px;
}

#app .gm-compose .gm-address-group legend,
#app .gm-compose .gm-letter-heading {
  font-family: var(--kv-writing);
  font-size: 16px;
  color: var(--kv-ink);
}

#game-stage #app .gm-compose .gm-primary {
  background: #416d40;
  color: #fff9e8;
  border-color: #345c35;
  border-radius: 21px 20px 21px 19px;
  box-shadow: 0 3px 0 #284b2d;
}

#app .gm-compose .gm-address-row input,
#app .gm-compose .gm-address-row select {
  background: #fdf8e9ac;
  border: 1px solid #acc095;
  border-radius: 14px 12px 13px 11px;
}

#game-stage #app .gm-compose .gm-address-row {
  grid-template-columns: 65px minmax(0, 1fr);
}

#game-stage #app .gm-compose .city-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
}

#game-stage #app .gm-compose .city-row select {
  width: 100%;
  min-width: 0;
  font-size: 13px;
}

#game-stage #app .gm-compose [data-compose-back] {
  min-height: 42px;
  margin-top: 8px;
}

#game-stage #app:has(.receive-center) + #toast { bottom: 107px; }

#game-stage #app .journey-view-bar { top: 557px; height: 37px; }
#game-stage #app .journey-view-bar button { min-height: 39px; }

@keyframes postbox-introduction {
  from { transform: translateY(-135px) rotate(-8deg) scale(.23); opacity: .55; }
  72% { transform: translateY(6px) rotate(1deg) scale(1.012); opacity: 1; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #app.intro-closed .entry-intro .entry-envelope { animation: none; }
}


#app .entry-home .entry-world {
  touch-action: pinch-zoom;
}

#app .entry-home .entry-planet-resident {
  position: absolute;
  left: 0;
  top: -195px;
  width: 0;
  height: 0;
  pointer-events: none;
  transform-origin: 0 0;
}

#app .entry-home .entry-planet-resident[hidden] { display: none; }

#app .entry-planet-resident::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -16px;
  width: 32px;
  height: 6px;
  border-radius: 50%;
  background: #244d3d4d;
  filter: blur(1.2px);
}

#app .entry-planet-bear img {
  position: absolute;
  left: -28px;
  bottom: -2px;
  width: 56px;
  height: 61px;
  object-fit: contain;
  transform-origin: 50% 97%;
}

@keyframes planet-bear-walk {
  0%,100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-2.5px); }
}

@media (prefers-reduced-motion: no-preference) {
  #app .entry-planet-bear img { animation: planet-bear-walk .82s ease-in-out infinite; }
}


#game-stage #app .receive-center .trip-stamp-list {
  display: grid;
  gap: 7px;
}

#game-stage #app .receive-center .trip-stamp {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 59px;
  padding: 6px 11px 6px 8px;
  text-align: left;
  color: var(--kv-forest);
  background: #fff8e6;
  border: 1px solid #728e5b;
  border-radius: 8px;
}

#app .trip-stamp strong,
#app .trip-stamp strong + span { display: block; }
#app .trip-stamp strong + span { margin-top: 4px; font-size: 12px; }
#app .trip-stamp .trip-stamp-art {
  display: grid;
  place-items: center;
  width: 45px;
  height: 44px;
  color: #486735;
  background: #e5edc6;
  border: 1px dashed currentColor;
  border-radius: 7px;
  font: 700 24px/1 var(--kv-label);
}
#app .trip-stamp[data-trip-mode=rocket] .trip-stamp-art{color:#43677a;background:#dfeef2}
#app .trip-stamp[data-trip-mode=broom] .trip-stamp-art{color:#815b54;background:#f5dfca}
#app .trip-stamp[data-trip-mode=bike] .trip-stamp-art{color:#366b63;background:#dceee4}
#app .trip-stamp[data-trip-mode=moto] .trip-stamp-art{color:#745d35;background:#f3e5c6}
