:root {
  font:
    600 16px/1.45 "Avenir Next",
    "Trebuchet MS",
    sans-serif;
  color: #263f43;
  background: #f5ebd8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: linear-gradient(120deg, #fcf3e3, #ede7d3);
  min-height: 100vh;
}
h1,
h2,
p {
  margin: 0;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  font: inherit;
  color: inherit;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 4px solid #664295;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.game-shell {
  max-width: 1140px;
  margin: auto;
  padding: clamp(10px, 2.5vw, 30px);
}
.topbar {
  margin-bottom: 16px;
}
.home-link {
  border: 1px solid #c8c2a7;
  border-radius: 50%;
  box-shadow: none;
  background: #fff9eb;
  color: #273e41;
}
h1,
h2 {
  font-family: Georgia, serif;
  letter-spacing: -0.045em;
}
h1 {
  font-size: clamp(25px, 4vw, 46px);
  line-height: 1.12;
}
.total-pill {
  display: flex;
  gap: 6px;
  align-items: center;
  background: #ffeed1;
  border: 1px solid #dbbb92;
  padding: 7px 14px;
  border-radius: 30px;
  font-size: 14px;
}
.total-pill span {
  color: #b34e4b;
}
.total-pill strong {
  font-size: 18px;
}
.park-card {
  background: #fff9e9;
  border: 1px solid #d6cbae;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 20px #6342241a;
}
.scene-heading {
  padding: 9px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.scene-heading p,
.ticket-text p {
  font-size: 12px;
  color: #576c60;
}
.scene-heading h2 {
  font-size: clamp(23px, 2.7vw, 32px);
  line-height: 1.15;
}
.dots {
  display: flex;
  gap: 5px;
}
.dots i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px dashed #b1b9a0;
  background: #eee8d8;
}
.dots i.met {
  background: #d47964;
  border: 2px solid #a85545;
}
.scene {
  isolation: isolate;
  position: relative;
  width: 100%;
  height: clamp(330px, 43vw, 480px);
  overflow: hidden;
}
.scenery,
.people,
.confetti,
.press {
  position: absolute;
  inset: 0;
}
.scenery {
  background: #b3cf81 center/100% 100% no-repeat;
}
.person {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  bottom: var(--bottom);
  left: var(--x);
  transform: translateX(-50%);
  height: var(--height);
  width: 18%;
  border: 0;
  padding: 0;
  background: transparent;
  isolation: isolate;
}
.person:before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 19%;
  width: 62%;
  height: 7%;
  border-radius: 50%;
  background: #38472140;
  z-index: -1;
}
.person:hover .portrait {
  translate: 0 -3px;
}
.portrait {
  position: relative;
  height: 100%;
  max-width: 100%;
  aspect-ratio: var(--ratio);
  transition: translate 0.15s;
  pointer-events: none;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
  filter: drop-shadow(1px 2px 1.5px #352c202b);
}
.print-word,
.album-patch {
  --patch: #fff4cd;
  --edge: #a66a3a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: var(--label-y);
  left: var(--label-x);
  transform: translate(-50%, -50%) rotate(var(--tilt));
  white-space: nowrap;
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 900;
  line-height: 1;
  color: #263938;
  letter-spacing: 0.01em;
  font-size: clamp(13px, 1.6vw, 22px);
  padding: 0.12em 0.18em 0.14em;
  background: var(--patch);
  border: 1px dashed var(--edge);
  border-radius: 0.18em;
  text-shadow: 0 1px #fff7;
}
.print-word.symbol {
  font-size: clamp(18px, 2.5vw, 32px);
  border: none;
  background: none;
  color: #593c39;
}
.person.met .portrait:after {
  content: "✓";
  position: absolute;
  bottom: 1%;
  right: 5%;
  font: bold 17px/23px sans-serif;
  width: 24px;
  height: 24px;
  color: white;
  background: #32654d;
  border: 2px solid #fff1c6;
  border-radius: 50%;
  box-sizing: content-box;
}
.person.greet .portrait {
  animation: hello 0.45s ease;
}
.clue-strip {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 20px;
  border-top: 3px solid #d4b685;
  background:
    repeating-linear-gradient(0deg, #0000 0 26px, #dfd8c033 27px), #fff6dc;
}
.ticket-mark {
  font-size: 32px;
  color: #a25542;
}
.ticket-text {
  flex: 1;
}
.ticket-text strong {
  display: block;
  font-size: clamp(21px, 2.7vw, 34px);
  line-height: 1.14;
  font-family: Georgia, serif;
}
.ticket-tools {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.ticket-tools button,
.choices button,
.restart {
  border: 1px solid #c4baa0;
  border-radius: 20px;
  padding: 9px 13px;
  font-size: 13px;
  background: #fffaee;
  font-weight: 700;
}
.primary,
.ticket-tools .primary {
  border: 0;
  background: #285a52;
  color: #fff8de;
  padding: 11px 18px;
  border-radius: 11px;
  box-shadow: 0 3px 0 #193f37;
}
.status-bar {
  padding: 8px 20px;
  color: #455d51;
  font-size: 14px;
  min-height: 38px;
  border-top: 1px solid #ebe0c5;
}
.shelf {
  display: flex;
  align-items: start;
  gap: 16px;
  margin: 14px 0;
}
.book {
  flex: 1;
  min-width: 0;
}
.book summary {
  cursor: pointer;
  font-size: 14px;
  padding: 8px 0;
}
.book p {
  font-size: 13px;
  margin-top: 8px;
}
.restart {
  background: transparent;
  white-space: nowrap;
}
.choices {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.choices button[aria-pressed="true"] {
  background: #35574a;
  color: white;
  border-color: #35574a;
}
.choices button {
  min-height: 38px;
}
.press {
  background: #263e3980;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 12px;
}
.print-tools {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  align-items: center;
  text-align: left;
  gap: 18px;
  max-width: 550px;
  width: 100%;
  padding: 18px;
  background: #fff6df;
  border: 2px solid #eed3a1;
  border-radius: 18px;
  box-shadow: 0 5px 18px #312e324d;
}
.print-tools h2 {
  font-size: 30px;
}
.inks p {
  font-size: 14px;
  color: #5e6c59;
}
.inks .choices {
  margin-top: 9px;
}
.inks .primary {
  margin-top: 12px;
}
.print-preview {
  position: relative;
  aspect-ratio: 0.7;
  max-height: 220px;
  justify-self: center;
  height: 100%;
  width: auto;
}
.print-preview .portrait {
  display: block;
  width: 100%;
}
.print-preview .print-word {
  font-size: clamp(17px, 2.3vw, 25px);
}
.press.stamped .print-preview {
  animation: ink 0.4s ease;
}
[data-pattern="waves"] {
  --cloth: url(art/patch-waves.webp);
}
[data-pattern="stars"] {
  --cloth: url(art/patch-stars.webp);
}
[data-pattern="petals"] {
  --cloth: url(art/patch-petals.webp);
}
.print-word[data-pattern],
.album-patch[data-pattern] {
  background: transparent var(--cloth) center/100% 100% no-repeat;
  border: none;
  border-radius: 0;
  padding: 0.25em 0.31em 0.27em;
}
#patterns button {
  background: transparent var(--cloth) center/100% 100% no-repeat;
  border: 1px solid transparent;
  color: #3c4c3f;
  border-radius: 6px;
  padding: 6px 9px;
}
#patterns button[aria-pressed="true"] {
  outline: 2px solid #507661;
  outline-offset: 1px;
}
.album-patch {
  position: static;
  transform: rotate(-3deg);
  padding: 5px 8px;
  font-size: 15px;
  margin: 5px;
}
.confetti {
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
.confetti i {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 11px;
  background: var(--ink);
  left: var(--left);
  animation: fall 1.8s var(--delay) both ease-in;
}
.press:has(.press-done) .ink-controls {
  display: none;
}
@keyframes hello {
  35% {
    rotate: -3deg;
  }
  75% {
    rotate: 3deg;
  }
}
@keyframes ink {
  50% {
    transform: scale(0.88);
  }
}
@keyframes fall {
  to {
    top: 110%;
    rotate: 240deg;
  }
}
@media (max-width: 700px) {
  .game-shell .topbar {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 10px;
  }
  .game-shell .topbar > .total-pill:last-child {
    grid-column: auto;
    justify-self: end;
    padding: 4px 7px;
    font-size: 11px;
  }
  .total-pill strong {
    font-size: 15px;
  }
  .home-link {
    width: 36px;
    height: 36px;
  }
  .scene {
    height: clamp(350px, 90vw, 435px);
  }
  .scene-heading {
    padding: 7px 12px;
  }
  .dots {
    gap: 3px;
  }
  .dots i {
    width: 12px;
    height: 12px;
  }
  .person {
    width: 30%;
    height: 42%;
    left: var(--mobile-x);
    bottom: var(--mobile-bottom);
  }
  .person .print-word {
    font-size: clamp(13px, 3.4vw, 19px);
  }
  .clue-strip {
    padding: 9px 11px;
    gap: 8px;
  }
  .ticket-mark {
    display: none;
  }
  .ticket-tools {
    max-width: 38%;
    justify-content: flex-end;
  }
  .ticket-tools button {
    font-size: 11px;
    padding: 8px;
  }
  .status-bar {
    font-size: 12px;
    padding: 7px 11px;
  }
  .shelf {
    flex-wrap: wrap;
    gap: 5px 12px;
  }
  .book summary {
    font-size: 12px;
  }
  .restart {
    padding: 6px 8px;
    font-size: 11px;
  }
  .print-tools {
    gap: 8px;
    padding: 10px;
    grid-template-columns: 0.9fr 1.4fr;
  }
  .print-tools h2 {
    font-size: 24px;
  }
  .inks p {
    font-size: 12px;
  }
  .inks .choices {
    gap: 4px;
  }
  .choices button {
    font-size: 11px;
    padding: 6px 8px;
    min-height: 35px;
  }
  .print-preview {
    max-height: 180px;
  }
  .press {
    padding: 6px;
  }
  .scenery {
    background-size: auto 100%;
  }
}
@media (max-width: 370px) {
  h1 {
    font-size: 20px;
  }
  .game-shell {
    padding: 6px;
  }
  .total-pill span {
    display: none;
  }
  .clue-strip {
    gap: 3px;
  }
  .person .print-word {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
  .confetti {
    display: none;
  }
}
.press.stamped .inks p {
  color: #416249;
}
.print-preview .portrait {
  max-width: 100%;
}
@media (max-width: 700px) {
  .person .print-word {
    font-size: clamp(15px, 3.8vw, 20px);
  }
  .ticket-tools button,
  .inks .choices button {
    min-height: 40px;
  }
}
.print-tools {
  max-height: calc(100% - 4px);
  overflow: auto;
  align-items: center;
}
.print-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 0.7;
  max-height: 180px;
}
.print-preview .portrait {
  height: 100%;
  width: auto;
  max-width: 100%;
  margin: auto;
}
.press .inks {
  min-width: 0;
}
.press .inks .primary {
  max-width: 100%;
  line-height: 1.25;
}
@media (max-width: 400px) {
  .print-tools {
    grid-template-columns: minmax(70px, 0.7fr) minmax(0, 1.4fr);
    padding: 10px 8px;
  }
  .inks .choices {
    margin-top: 6px;
  }
  .inks .choices button {
    min-height: 34px;
    padding: 5px 7px;
  }
  .inks .primary {
    font-size: 13px;
  }
  .print-tools h2 {
    font-size: 22px;
  }
}
#print-model {
  height: 100%;
  width: 100%;
  position: relative;
}
.press.rolling .print-tools {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  max-width: 640px;
}
.press.rolling .print-preview {
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  width: 100%;
}
.press.rolling #print-model {
  height: clamp(90px, 15vw, 150px);
  width: 100%;
  margin-bottom: 8px;
}
#ink-plate {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  touch-action: none;
  background: #a57049;
  border: 3px solid #7b5239;
  padding: 9px 5px;
  border-radius: 8px;
  box-shadow:
    inset 0 -4px 0 #80513788,
    0 4px 0 #6f472b;
}
#ink-plate button {
  flex: 1 1 35px;
  max-width: 50px;
  min-width: 0;
  height: 48px;
  touch-action: none;
  font:
    900 clamp(18px, 2.4vw, 30px) / 1 Georgia,
    serif;
  color: #796b4f;
  background: #f2e3bd;
  border: 1px solid #a28e64;
  border-radius: 5px;
  box-shadow: 0 3px 0 #705638;
  transition: background 0.12s;
}
#ink-plate button.inked {
  color: #fff6d7;
  background: #33675b;
  box-shadow: inset 0 3px 0 #234e42;
  transform: translateY(2px);
}
#change-patch {
  margin-top: 8px;
}
@media (max-width: 500px) {
  .press.rolling .print-tools {
    grid-template-columns: 1fr;
    gap: 6px;
    max-width: 310px;
    text-align: center;
  }
  .press.rolling #print-model {
    height: 80px;
  }
  .press.rolling .inks p {
    font-size: 12px;
  }
  .press.rolling .inks button {
    margin-top: 7px;
  }
  .press.rolling .print-preview {
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .press.rolling #print-model {
    max-width: 49px;
    margin: 0;
  }
  .press.rolling #ink-plate {
    flex: 1;
  }
  .press.rolling #ink-plate button {
    font-size: 20px;
  }
}

#letter-case {
  width: min(510px, 92vw);
  max-height: 94dvh;
  overflow-y: auto;
  background: #fff6df;
  color: #364b3e;
  border: 3px solid #cdab78;
  border-radius: 17px;
  box-shadow: 0 14px 55px #30271660;
  padding: 14px;
}
#letter-case::backdrop {
  background: #20362bba;
}
#letter-case header,
.case-word {
  display: flex;
  align-items: center;
  gap: 8px;
}
#letter-case header {
  justify-content: space-between;
}
#letter-case h2 {
  margin: 0;
  font-size: clamp(20px, 4vw, 32px);
}
#letter-case p {
  margin: 3px 0 8px;
}
#case-close,
#case-lift {
  min-height: 42px;
  min-width: 42px;
  background: #fbecd0;
  color: inherit;
  border: 1px solid #d4b881;
  border-radius: 8px;
}
#case-word {
  width: 0;
  flex: 1;
  color: #324739;
  letter-spacing: 0.16em;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  background: #fffdf1;
  border: 2px dashed #c2a67b;
  border-radius: 7px;
  padding: 7px;
}
#letter-blocks {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  background: #93663f;
  border: 4px solid #78523a;
  border-radius: 9px;
  padding: 7px;
  margin: 8px 0;
}
#letter-blocks button {
  min-height: 42px;
  min-width: 0;
  padding: 1px;
  color: #66412f;
  border: 1px solid #c5a16f;
  border-radius: 5px;
  background: linear-gradient(#f6dcad, #ecc78e);
  font:
    900 clamp(19px, 3.3vw, 26px) / 1 Georgia,
    serif;
  box-shadow: 0 2px 0 #65462e;
}
#letter-blocks button:active {
  transform: translateY(2px);
}
#letter-blocks button:disabled {
  opacity: 0.6;
}
#case-use {
  display: block;
  margin-left: auto;
}
@media (max-width: 410px) {
  #letter-case {
    padding: 10px;
  }
  #letter-blocks {
    gap: 3px;
    padding: 5px;
  }
  #letter-blocks button {
    min-height: 37px;
  }
  .print-word {
    letter-spacing: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .person.returning .portrait {
    animation: patch-greeting 1.15s ease-in-out 2;
    transform-origin: 50% 95%;
  }
  @keyframes patch-greeting {
    20% {
      rotate: -4deg;
      translate: 0 -5px;
    }
    50% {
      rotate: 3deg;
    }
    75% {
      rotate: -1deg;
    }
  }
}

#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;
}

button.album-patch {
  cursor: pointer;
  min-height: 38px;
  padding: 8px 12px;
}
button.album-patch[aria-pressed="true"] {
  outline: 2px solid #567a59;
  outline-offset: 2px;
}

.ticket-clue {
  display: flex;
  align-items: center;
  gap: 7px;
}
.face-hint {
  width: 43px;
  height: 43px;
  flex-shrink: 0;
  border: 2px solid #63806a;
  border-radius: 50%;
  overflow: hidden;
  background: #e1e8ce;
}
.face-hint img {
  display: block;
  width: 91%;
  margin: 2px auto 0;
  height: auto;
}

@media (max-width: 700px) {
  .person .print-word.long-word {
    font-size: clamp(13px, 3.5vw, 17px);
    letter-spacing: -0.035em;
  }
}
@media (max-width: 500px) {
  .press.rolling .print-preview {
    flex-direction: column;
    gap: 2px;
  }
  .press.rolling #print-model {
    width: 100%;
    max-width: none;
    height: 104px;
  }
  .press.rolling #print-model .print-word {
    font-size: 14px;
  }
  .press.rolling #print-model .long-word {
    font-size: 12px;
    letter-spacing: -0.035em;
  }
  .press.rolling #ink-plate {
    flex: none;
    width: 100%;
  }
}

.press:not(.rolling):not(.stamped) .print-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.press:not(.rolling):not(.stamped) #print-model {
  flex: 1;
  min-height: 34px;
}
.wearer-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 3px;
}
.wearer-choice strong {
  min-width: 25px;
  font-size: 12px;
  text-align: center;
}
.wearer-choice button {
  padding: 0;
  min-width: 27px;
  min-height: 36px;
  font:
    bold 22px/1 Georgia,
    serif;
}

.word-greeting {
  position: absolute;
  left: 50%;
  top: 1%;
  transform: translate(-50%, -75%);
  border: 1px solid #8c755a;
  border-radius: 10px 12px 10px 3px;
  background: #fff8dc;
  color: #394f43;
  padding: 2px 6px;
  box-shadow: 0 1px 2px #5c44342b;
  font-size: clamp(10px, 1.2vw, 15px);
  font-weight: 800;
  line-height: 1.1;
  max-width: 105%;
  width: max-content;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .word-greeting {
    animation: greeting-appear 0.22s ease-out;
  }
  @keyframes greeting-appear {
    from {
      opacity: 0;
      translate: 0 5px;
    }
  }
}

.patch-tool {
  color: #38574b;
  background: #fff7e7;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid #cabea5;
  border-radius: 8px;
  min-height: 36px;
  padding: 4px 10px;
  margin: 5px 4px 0 0;
}

#hello-card {
  position: absolute;
  top: 8px;
  left: 48%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px 3px 3px;
  border: 2px solid #a47760;
  border-radius: 9px;
  color: #923f48;
  background: #fff5db;
  box-shadow: 0 2px 4px #503c3350;
  font-size: 19px;
  touch-action: none;
  cursor: grab;
}
#hello-card[hidden] {
  display: none;
}
#hello-card.flying {
  opacity: 0.8;
  cursor: grabbing;
}
.hello-face {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: #dfe7bd;
}
.hello-face img {
  display: block;
  width: 168%;
  max-width: none;
  margin: 0 0 0 -34%;
  pointer-events: none;
}
@media (max-width: 700px) {
  #hello-card {
    top: 4px;
    left: 4px;
    font-size: 15px;
    gap: 1px;
  }
  .hello-face {
    width: 35px;
    height: 35px;
  }
}
