:root {
  font:
    600 16px/1.4 "Avenir Next",
    "Trebuchet MS",
    sans-serif;
  color: #273e3a;
  background: #f5edd9;
  --teal: #285e54;
  --paper: #fff9e9;
  --rust: #af5039;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(120deg, #f7efdb, #f6e3c2);
}
button,
textarea {
  font: inherit;
  color: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.54;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #574398;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: Georgia, serif;
  letter-spacing: -0.04em;
  line-height: 1.14;
}
.game-shell {
  max-width: 1270px;
  margin: auto;
  padding: clamp(10px, 2.3vw, 30px);
}
.topbar {
  margin-bottom: 12px;
}
.home-link {
  border: 1px solid #c8c3a1;
  border-radius: 50%;
  box-shadow: none;
  background: #fff9eb;
  color: #273e41;
}
h1 {
  font-size: clamp(27px, 4vw, 47px);
}
.restart,
.undo,
.idea,
.key,
.keyboard-tools button,
.friend-tab,
.stamp-choice {
  border: 1px solid #c5b898;
  font-weight: 650;
  background: #fffae9;
  color: #334e43;
  border-radius: 12px;
  padding: 7px 11px;
  font-size: 13px;
}
.restart {
  border-radius: 30px;
}
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 4vw, 56px);
  padding: 8px 0;
  margin: 0 0 12px;
  list-style: none;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #67745c;
  font-size: 13px;
  white-space: nowrap;
}
.steps li span {
  border: 1px solid #adae90;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 11px;
}
.steps li[aria-current] {
  color: #274f43;
}
.steps li[aria-current] span,
.steps .done span {
  background: #356652;
  color: #fffbe7;
  border-color: #356652;
}
.steps li b {
  font-size: 11px;
}
.office,
.neighborhood {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #c8bb98;
  box-shadow: 0 7px 20px #463b241c;
  background: var(--paper);
}
.office {
  background: #7d9372 url(art/post-office.webp) center/cover;
}
.office-heading {
  position: relative;
  width: max-content;
  max-width: calc(100% - 28px);
  margin: 16px 18px 0;
  padding: 10px 15px;
  border-radius: 6px;
  background: #fff4ddeb;
  box-shadow: 0 3px 9px #332a2333;
}
.office-heading h2,
.delivery-heading h2 {
  font-size: clamp(21px, 2.6vw, 30px);
}
.office-heading p,
.delivery-heading p {
  font-size: 13px;
  margin-top: 2px;
}
.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(185px, 24%, 280px);
  gap: clamp(16px, 3vw, 40px);
  align-items: end;
  padding: 18px 20px 20px;
}
.computer {
  min-width: 0;
}
.monitor {
  background: #fff8e7;
  border: 6px solid #36574b;
  border-radius: 15px;
  box-shadow:
    0 5px 0 #263d34,
    0 10px 18px #2b322733;
  overflow: hidden;
}
.screen-bar {
  background: #37624f;
  color: #fff6d8;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.screen-content,
.computer-summary {
  padding: 12px;
}
.friend-tabs,
.send-row,
#stamps,
.sticker-tray,
#message-ideas,
.keyboard-tools {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.friend-tabs {
  margin-bottom: 10px;
}
.friend-tab {
  padding: 6px 12px;
  min-height: 36px;
}
.friend-tab[aria-pressed="true"] {
  background: var(--friend-light);
  border: 2px solid var(--friend-dark);
  padding: 5px 11px;
}
.postcard-sheet {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1fr);
  padding: 14px 11px;
  gap: 13px;
  background:
    linear-gradient(#fff9e9, #fff9e9) padding-box,
    repeating-linear-gradient(
        125deg,
        #b7624b 0 8px,
        #f7e7c4 8px 16px,
        #547d6d 16px 24px,
        #f7e7c4 24px 32px
      )
      border-box;
  border: 4px solid transparent;
  box-shadow: 0 3px 6px #5e4b2014;
}
.word-pane {
  border-left: 1px solid #d9c9a7;
  padding-left: 12px;
  min-width: 0;
}
.word-pane label {
  font:
    italic 19px Georgia,
    serif;
}
.field-label,
.ideas > span {
  display: block;
  font-size: 12px;
  color: #60725e;
  margin-bottom: 4px;
}
.picture {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.38;
  overflow: hidden;
  border: 1px solid #b5c1a3;
  border-radius: 5px;
  background:
    radial-gradient(ellipse at 30% 85%, #a7bc85 0 18%, transparent 19%),
    radial-gradient(ellipse at 90% 100%, #93aa7a 0 40%, transparent 41%),
    linear-gradient(#c4ded2 0 65%, #d6d9a8 66%);
}
.picture:empty:after {
  content: "Tap to place a sticker";
  position: absolute;
  inset: auto 0 8px;
  color: #405740;
  font-size: 12px;
  text-align: center;
}
.sticker-tray {
  justify-content: center;
  margin-top: 5px;
  gap: 4px;
}
.sticker-tray button {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 7px;
  background: #f5eddb;
  border: 1px solid #cabc9b;
  padding: 2px;
}
.sticker-tray [aria-pressed="true"] {
  background: #f9dfa7;
  border: 2px solid #ad7430;
}
.sticker-tray img {
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
}
.stuck {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--angle));
  width: 30%;
  height: 36%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px #62573349);
}
.undo {
  font-size: 11px;
  padding: 4px 8px;
  margin-top: 4px;
  border: 0;
  background: none;
  text-decoration: underline;
}
textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 66px;
  max-height: 180px;
  line-height: 1.5;
  background: repeating-linear-gradient(
    transparent 0 22px,
    #cfc8b288 23px 24px
  );
  border: 0;
  font-size: 14px;
  padding: 3px 1px;
}
.message-bottom {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-size: 10px;
  color: #63705a;
  margin: 3px 0 9px;
}
.idea {
  font-size: 11px;
  min-height: 33px;
  padding: 5px 8px;
  text-align: left;
}
.send-row {
  margin-top: 10px;
  justify-content: space-between;
}
.stamp-choice {
  width: 33px;
  height: 33px;
  padding: 2px;
  color: #905337;
  border-radius: 4px;
  border-style: dashed;
}
.stamp-choice[aria-pressed="true"] {
  background: #e5e9cf;
  border: 2px solid #58755c;
}
.primary {
  border: 0;
  background: #2e6454;
  color: #fff9e2;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 16px;
  min-height: 40px;
  border-radius: 10px;
  box-shadow: 0 3px 0 #194736;
}
.primary:disabled {
  background: #c7c8b4;
  color: #536151;
  box-shadow: none;
  opacity: 0.88;
}
.computer-summary {
  text-align: center;
  min-height: 180px;
  display: grid;
  justify-content: center;
  align-content: center;
  gap: 8px;
}
.computer-summary > span {
  font-size: 33px;
  color: #b96e40;
}
.computer-summary h3 {
  font-size: 30px;
}
.computer-summary p {
  font-size: 13px;
}
#key-drawer {
  background: #f7ebcf;
  border-radius: 10px;
  border: 1px solid #bbae8b;
  margin: 10px 3px 0;
  padding: 5px 10px;
}
summary {
  cursor: pointer;
  font-size: 13px;
}
.keyboard {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
}
.key {
  padding: 6px 0;
  font-size: 12px;
}
.keyboard-tools {
  margin: 5px 0;
}
.paper-station {
  text-align: center;
  position: relative;
  background: #fffaeade;
  border: 1px solid #ead8ae;
  border-radius: 13px;
  padding: 12px;
  box-shadow: 0 4px 8px #49372822;
}
.station-title h3 {
  font-size: 22px;
}
.printer-stage {
  position: relative;
  height: 145px;
  max-width: 230px;
  margin: 0 auto;
  isolation: isolate;
}
.printer {
  position: absolute;
  inset: auto 4% 0;
  width: 92%;
  height: 57%;
  object-fit: contain;
  object-position: center bottom;
}
.paper {
  position: absolute;
  bottom: 35%;
  left: 24%;
  width: 42%;
  height: 58%;
  background: #fffaea;
  border: 1px solid #cdbd97;
  transform: translateY(15%);
  border-radius: 3px;
  text-align: left;
  padding: 5px 6px;
  overflow: hidden;
  transition: transform 0.45s ease;
}
.paper.printed {
  transform: translateY(-17%);
}
.paper span,
.paper p {
  display: block;
  font-size: 9px;
  position: relative;
  z-index: 1;
}
.paper p {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.paper b {
  position: absolute;
  right: 4px;
  top: 4px;
  color: #965840;
}
.paper #paper-picture {
  position: absolute;
  inset: 17px 10px 0;
}
.printer.printing {
  animation: hum 0.18s infinite alternate;
}
.queue {
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 6px 0;
  font-size: 11px;
}
.queue .ready {
  color: #2b644e;
}
.paper-station > .primary {
  width: 100%;
  margin: 6px 0;
}
.printer-hint {
  font-size: 11px;
  color: #53634f;
}
.delivery-heading {
  padding: 11px 16px;
}
.route-map {
  position: relative;
  aspect-ratio: 1.9;
  max-height: 490px;
  overflow: hidden;
  isolation: isolate;
  background: #bbca85 url(art/route.webp) center/100% 100% no-repeat;
}
.route-map svg,
.route-map #houses,
.route-map #landmarks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.route-map button {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  pointer-events: auto;
}
.route-stop,
.mailbox {
  min-height: 42px;
  border: 2px solid #735c3c;
  border-radius: 8px;
  background: #fff4cf;
  box-shadow: 0 3px 0 #674e29a0;
  padding: 4px 9px;
  font-size: clamp(12px, 1.5vw, 17px);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.route-stop {
  border-radius: 50px;
}
.route-stop img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.mailbox {
  border-color: var(--friend-dark);
  background: var(--friend-light);
  color: #3a4738;
}
.mailbox:after,
.route-stop:after {
  content: "";
  position: absolute;
  left: 45%;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: #7d6949;
}
.mailbox:disabled {
  opacity: 0.8;
}
.route-stop.visited {
  box-shadow: 0 0 0 4px #e8d591;
}
.route-map #bicycle {
  position: absolute;
  left: 48%;
  top: 83%;
  width: 12%;
  height: 15%;
  object-fit: contain;
  transform: translate(-50%, 0);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition:
    left 0.65s ease-in-out,
    top 0.65s ease-in-out;
  filter: drop-shadow(1px 4px 2px #442c245e);
}
.route-map #houses,
.route-map #landmarks {
  z-index: 2;
}
.route-map.pedaling #bicycle {
  z-index: 3;
  transition: none;
  cursor: grabbing;
}
.mail-bag {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bag-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bag-label > span {
  font-size: 27px;
  color: #a8503c;
}
.bag-label strong,
.bag-label small {
  display: block;
}
.bag-label small {
  font-size: 12px;
}
.letters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.letter {
  font-size: 12px;
  padding: 7px 9px;
  background: var(--friend-light);
  border: 1px solid var(--friend-dark);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.letter[aria-pressed="true"] {
  outline: 3px solid #326953;
  outline-offset: 1px;
}
.reply {
  padding: 8px 15px;
  background: #e7ebce;
  font-size: 13px;
}
.reply strong {
  margin-right: 5px;
}
.celebration {
  border-top: 1px solid #ded1af;
  text-align: center;
  padding: 14px;
}
.celebration h3 {
  font-size: 26px;
}
.celebration .primary {
  margin-top: 10px;
}
#delivered-cards {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.souvenir {
  background: #fff4d4;
  border: 1px solid #cdbd97;
  text-align: left;
  border-radius: 5px;
  padding: 5px 8px;
  flex: 1;
  min-width: 90px;
  max-width: 240px;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.souvenir .picture {
  margin: 3px 0;
  aspect-ratio: 2.1;
  min-height: 50px;
}
.souvenir .picture:empty:after {
  content: none;
}
.wiggle {
  animation: wiggle 0.3s;
}
.confetti {
  position: fixed;
  left: 50%;
  top: 52%;
  width: 9px;
  height: 13px;
  border-radius: 2px;
  background: var(--color);
  animation: pop 1s forwards;
  pointer-events: none;
  z-index: 10;
}
footer {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  margin: 9px 5px;
}
footer span {
  color: var(--rust);
}
@keyframes pop {
  to {
    translate: var(--x) var(--y);
    opacity: 0;
    rotate: 200deg;
  }
}
@keyframes hum {
  to {
    translate: 1px -1px;
  }
}
@keyframes wiggle {
  30% {
    translate: -4px;
  }
  70% {
    translate: 4px;
  }
}
@media (max-width: 780px) {
  .game-shell {
    padding: 9px;
  }
  .game-shell .topbar {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 5px;
  }
  .home-link {
    width: 36px;
    height: 36px;
  }
  .game-shell .topbar > .restart:last-child {
    grid-column: auto;
    justify-self: end;
    font-size: 11px;
    padding: 6px 8px;
  }
  .steps {
    gap: 10px;
    margin: 0 0 5px;
    justify-content: start;
  }
  .steps li {
    font-size: 11px;
    gap: 3px;
  }
  .steps li b {
    font-size: 9px;
  }
  .office-heading {
    margin: 10px 10px 0;
    padding: 6px 10px;
  }
  .desk {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }
  .paper-station {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    padding: 8px;
  }
  .station-title {
    grid-column: 1;
    grid-row: 1;
  }
  .printer-stage {
    grid-column: 1;
    grid-row: 2/5;
    width: 100%;
    height: 100px;
  }
  .queue {
    grid-column: 2;
    grid-row: 2;
  }
  .paper-station > .primary {
    grid-column: 2;
    grid-row: 3;
  }
  .printer-hint {
    grid-column: 2;
    grid-row: 4;
  }
  .desk:has(#writing-tools[hidden]) .computer-summary {
    min-height: 90px;
    padding: 8px;
  }
  .postcard-sheet {
    gap: 7px;
    padding: 9px 7px;
  }
  .screen-content {
    padding: 8px;
  }
  .word-pane {
    padding-left: 7px;
  }
  .word-pane label {
    font-size: 16px;
  }
  .sticker-tray {
    gap: 2px;
  }
  .sticker-tray button {
    width: 30px;
    height: 33px;
  }
  .picture {
    aspect-ratio: 0.95;
  }
  .idea {
    font-size: 11px;
    padding: 4px 6px;
    min-height: 30px;
  }
  .send-row {
    margin-top: 7px;
  }
  .friend-tab {
    font-size: 12px;
    padding: 5px 9px;
  }
  .friend-tab[aria-pressed="true"] {
    padding: 4px 8px;
  }
  .route-map {
    aspect-ratio: 1.2;
  }
  .mail-bag {
    display: block;
    padding: 8px;
  }
  .letters {
    margin-top: 7px;
  }
  .route-stop,
  .mailbox {
    font-size: 11px;
    padding: 4px 6px;
    min-height: 36px;
    gap: 2px;
  }
  .route-stop img {
    width: 22px;
    height: 22px;
  }
  .delivery-heading {
    padding: 8px;
  }
  .delivery-heading p {
    font-size: 12px;
  }
  .bag-label > span {
    font-size: 19px;
  }
  .mailbox:after,
  .route-stop:after {
    border-width: 4px;
  }
  .picture:empty:after {
    font-size: 10px;
  }
  .souvenir {
    font-size: 11px;
  }
}
@media (max-width: 390px) {
  .steps {
    gap: 5px;
  }
  .steps li span {
    display: none;
  }
  .screen-content {
    padding: 5px;
  }
  .word-pane {
    padding-left: 4px;
  }
  .sticker-tray button {
    width: 28px;
  }
  .friend-tabs {
    gap: 3px;
  }
  .letter {
    font-size: 11px;
    padding: 6px;
  }
  .mailbox {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
  .confetti {
    display: none;
  }
}
.route-map {
  width: 100%;
  max-height: none;
  height: clamp(310px, 43vw, 500px);
  aspect-ratio: auto;
}
.delivery-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.delivery-heading > p {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}
.address-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: #fff1cd;
  border: 1px dashed #b8a57d;
  border-radius: 5px;
  font-size: 12px;
}
.address-stamp img {
  width: 26px;
  height: 24px;
  object-fit: contain;
}
.address-stamp.marked {
  background: #dce8d1;
  border-color: #819a78;
}
.address-stamp.current {
  box-shadow: 0 2px 0 #a66e3d;
}
.ride-stop {
  opacity: 0.9;
}
.route-map button:disabled {
  pointer-events: none;
}
.mail-guidance {
  position: relative;
  display: block;
  margin: 0;
  background: #fff3cf;
  color: #634c2d;
  padding: 6px 14px;
  font-size: 13px;
}
.sticker-tray button {
  min-width: 40px;
  min-height: 40px;
}
.stamp-choice {
  min-width: 36px;
  min-height: 36px;
}
@media (max-width: 780px) {
  .route-map {
    height: clamp(305px, 77vw, 435px);
  }
  .delivery-heading {
    display: block;
  }
  .delivery-heading > p {
    margin-top: 6px;
  }
  .address-stamp {
    font-size: 10px;
    padding: 3px 5px;
    gap: 3px;
  }
  .address-stamp img {
    width: 18px;
    height: 18px;
  }
  .sticker-tray {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .sticker-tray button {
    width: 100%;
    min-width: 0;
    min-height: 36px;
  }
  .sticker-tray img {
    height: 28px;
  }
  .route-stop,
  .mailbox {
    min-height: 44px;
  }
  .letters button {
    min-height: 40px;
  }
}
.bag-preview.picture {
  width: 86px;
  flex: none;
  min-height: 44px;
  aspect-ratio: 1.5;
  padding: 5px 6px;
  border: 2px solid #fff4cd;
  outline: 1px solid #b5b595;
  font-size: 9px;
  line-height: 1.2;
  text-align: left;
  overflow: hidden;
  box-shadow: 1px 2px 0 #6f6c5122;
  transform: rotate(-3deg);
}
.bag-preview.picture:empty:after {
  content: none;
}
@media (max-width: 780px) {
  .bag-preview.picture {
    width: 61px;
    min-height: 36px;
  }
}
.tools-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 5px;
}
.tools-tabs button {
  background: transparent;
  color: #485a4d;
  border: 1px solid transparent;
  border-radius: 20px;
  min-height: 32px;
  font-size: 12px;
  padding: 3px 11px;
}
.tools-tabs button[aria-pressed="true"] {
  border-color: #c8bd99;
  background: #f3e5c2;
  font-weight: 800;
}
.crayon-tray {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 5px;
}
.crayon-tray button {
  width: 39px;
  height: 39px;
  position: relative;
  background: #f9f1de;
  border: 1px solid #cfbea0;
  border-radius: 8px;
  isolation: isolate;
}
.crayon-tray button:after {
  content: "";
  position: absolute;
  inset: 6px 13px 5px;
  clip-path: polygon(50% 0, 100% 22%, 100% 100%, 0 100%, 0 22%);
  background: linear-gradient(
    180deg,
    var(--crayon) 0 32%,
    #f6ebc9 32% 38%,
    var(--crayon) 38% 78%,
    #f7e4ac 78% 84%,
    var(--crayon) 84%
  );
  transform: rotate(26deg);
}
.crayon-tray [aria-pressed="true"] {
  background: #f2dcaa;
  border: 2px solid #916e45;
}
.card-ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.picture.drawing {
  touch-action: none;
  cursor: crosshair;
}
.picture.drawing:empty:after {
  content: "Draw here";
}
.picture-pane .undo {
  min-height: 28px;
}
@media (max-width: 780px) {
  .tools-tabs button {
    font-size: 11px;
    padding: 3px 5px;
  }
  .crayon-tray {
    gap: 2px;
    flex-wrap: wrap;
  }
  .crayon-tray button {
    width: 32px;
    height: 35px;
  }
  .crayon-tray button:after {
    inset: 5px 9px;
  }
}

.pen-pal {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
  vertical-align: middle;
}
.friend-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mailbox .pen-pal {
  width: 27px;
  height: 27px;
}
.address-stamp .pen-pal {
  width: 25px;
  height: 25px;
}
.reply {
  align-items: center;
}
.reply .pen-pal {
  width: 35px;
  height: 35px;
}
@media (max-width: 500px) {
  .friend-tab .pen-pal {
    width: 24px;
    height: 24px;
  }
  .mailbox .pen-pal,
  .address-stamp .pen-pal {
    width: 20px;
    height: 20px;
  }
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#open-album,
.keep-card,
#post-album button {
  min-height: 32px;
  padding: 4px 8px;
  color: #365848;
  background: #f7efd5;
  border: 1px solid #baa980;
  border-radius: 9px;
  font-weight: 700;
}
.keep-card {
  width: 100%;
  font-size: 12px;
}
.kept-stamp {
  float: right;
  color: #996b49;
}
#post-album {
  width: min(520px, 92vw);
  max-height: 92dvh;
  overflow-y: auto;
  border: 2px solid #baa47b;
  border-radius: 17px;
  padding: 13px;
  color: #344c40;
  background: #f1e4c3;
  box-shadow: 0 13px 55px #242f2f55;
}
#post-album::backdrop {
  background: #233d31b0;
}
#post-album header,
.album-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
#post-album h2 {
  font-family: Georgia, serif;
  font-size: clamp(20px, 4vw, 30px);
  margin: 0;
}
#album-pages {
  margin: 10px 0;
}
#album-pages .souvenir {
  padding: 12px;
  background: #fff9e7;
  border: 1px solid #cab693;
  border-radius: 6px;
  box-shadow: 0 3px 4px #5046292a;
  transform: rotate(-0.6deg);
}
#album-pages .picture {
  aspect-ratio: 1.9;
  min-height: 100px;
}
#album-pages .souvenir p {
  min-height: 20px;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  font-size: 15px;
}
#remove-page {
  display: block;
  margin: 8px auto 0;
}
@media (max-width: 500px) {
  #open-album {
    font-size: 11px;
    min-height: 26px;
  }
  .brand {
    gap: 1px;
  }
}

.tiny-letter {
  position: fixed;
  z-index: 6;
  width: 33px;
  height: 23px;
  pointer-events: none;
  background: #fff2cd;
  color: #c56552;
  border: 1px solid #af9870;
  border-radius: 2px;
  box-shadow: 0 3px 4px #49341d44;
  text-align: center;
}

#play-sound {
  width: fit-content;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid #c4b99f;
  color: #405748;
  background: #fff9e8;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.step-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 7px;
}
.step-rail .steps {
  margin: 0;
  min-width: 0;
  flex: 1;
}
.step-rail #play-sound {
  min-height: 30px;
  font-size: 12px;
}
@media (max-width: 500px) {
  .step-rail #play-sound {
    font-size: 11px;
    padding: 4px 6px;
    min-height: 28px;
  }
  .step-rail .steps {
    gap: 5px;
  }
}
.monitor {
  border-color: #aa7953;
  border-width: 4px;
  border-radius: 9px;
  box-shadow:
    0 4px 0 #775234,
    0 8px 13px #37261c33;
}
.ideas summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  margin: 6px 0;
  color: #46614b;
}
.ideas[open] summary {
  margin-bottom: 5px;
}
.picture,
#paper-picture {
  background: #f7f2e0 url(art/card-paper.webp) center / 100% 100% no-repeat;
}
#picture:empty:after {
  color: #706e5c;
  bottom: 20%;
  font-weight: 600;
}
.word-pane textarea {
  border: 0;
  border-bottom: 1px solid #b7b49a;
  background: repeating-linear-gradient(
    180deg,
    transparent 0 1.55em,
    #c8c8ac70 1.55em calc(1.55em + 1px)
  );
  box-shadow: none;
  border-radius: 0;
  line-height: 1.58;
}

#stickers button {
  touch-action: none;
  cursor: grab;
}
.peeled-sticker {
  position: fixed;
  z-index: 25;
  width: clamp(44px, 8vw, 78px);
  height: clamp(44px, 8vw, 78px);
  object-fit: contain;
  transform: translate(-50%, -59%) rotate(-9deg);
  filter: drop-shadow(0 5px 3px #60523c60);
  pointer-events: none;
}

.letters .letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.letters .pen-pal {
  width: 23px;
  height: 23px;
}
@media (max-width: 500px) {
  .route-stop img,
  .mailbox .pen-pal {
    width: 31px;
    height: 31px;
  }
  .address-stamp img,
  .address-stamp .pen-pal {
    width: 26px;
    height: 26px;
  }
}

.reply {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 0;
}
.thankful-pal {
  width: 66px;
  height: 68px;
  flex: none;
  align-self: end;
  object-fit: contain;
  object-position: center bottom;
}
@media (prefers-reduced-motion: no-preference) {
  .thankful-pal {
    animation: pal-arrives 0.32s ease-out both;
    transform-origin: center bottom;
  }
  @keyframes pal-arrives {
    from {
      transform: translateY(6px) rotate(-4deg);
      opacity: 0.4;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }
}

.picture-address {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  color: #625139;
  font-size: 0.76rem;
  padding: 4px 0;
}
.picture-address strong {
  margin-right: 4px;
}
.picture-address img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

#words-drawer > summary {
  font-weight: 700;
  cursor: pointer;
  padding: 0.4em 0;
}
#words-drawer[open] > summary {
  margin-bottom: 0.4em;
}
#picture.new-paper.drawing::after {
  content: "✎ 〰";
  position: absolute;
  left: 25%;
  top: 29%;
  font:
    italic clamp(28px, 5vw, 48px) Georgia,
    serif;
  color: #ab7554;
  opacity: 0.65;
  transform: rotate(-12deg);
  pointer-events: none;
}
#send {
  display: flex;
  align-items: center;
  gap: 6px;
}
.feed-picture {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 21px;
}
.feed-picture img {
  width: 42px;
  height: 29px;
  object-fit: contain;
}

#send {
  touch-action: none;
}
.feed-picture b {
  display: inline-block;
  transform: translateX(var(--feed, 0px));
}

.postcard-sheet:has(#words-drawer:not([open])) {
  grid-template-columns: 1fr;
}
.postcard-sheet:has(#words-drawer:not([open])) .word-pane {
  border-left: 0;
  border-top: 1px solid #d8c9a3;
  padding: 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.postcard-sheet:has(#words-drawer:not([open])) #picture {
  aspect-ratio: 2.2;
  height: clamp(144px, 24vw, 205px);
  min-height: 144px;
}
.postcard-sheet:has(#words-drawer:not([open])) .picture-pane {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 7px;
  align-items: center;
}
.postcard-sheet:has(#words-drawer:not([open])) #picture,
.postcard-sheet:has(#words-drawer:not([open])) .sticker-tray,
.postcard-sheet:has(#words-drawer:not([open])) .crayon-tray {
  grid-column: 1 / -1;
}
.postcard-sheet:has(#words-drawer:not([open])) .tools-tabs {
  grid-row: 2;
  grid-column: 1;
}
.postcard-sheet:has(#words-drawer:not([open])) .undo {
  grid-row: 2;
  grid-column: 2;
}

.drawing-desk .desk {
  grid-template-columns: 1fr;
}
.drawing-desk .computer {
  width: min(100%, 870px);
  margin-inline: auto;
}
.paper-station[hidden] {
  display: none;
}
