:root {
  --ink: #f7f3df;
  --muted: rgba(247, 243, 223, 0.78);
  --panel: rgba(20, 34, 33, 0.72);
  --panel-solid: #142221;
  --line: rgba(247, 243, 223, 0.18);
  --leaf: #8ebf76;
  --sun: #f0bd6c;
  --water: #67b4c8;
  --berry: #ce6f75;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
  --app-height: 100dvh;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-height: var(--app-height);
  color: var(--ink);
  background: #101817;
  font-family: "Nunito", system-ui, sans-serif;
  overscroll-behavior: none;
  touch-action: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: var(--app-height);
  overflow: hidden;
  background: #101817;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: var(--app-height);
  display: block;
  touch-action: none;
}

.game-shell:fullscreen,
.game-shell:-webkit-full-screen,
html:fullscreen,
html:-webkit-full-screen,
body:fullscreen,
body:-webkit-full-screen {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #101817;
}

.game-shell:fullscreen #gameCanvas,
.game-shell:-webkit-full-screen #gameCanvas,
html:fullscreen #gameCanvas,
html:-webkit-full-screen #gameCanvas {
  width: 100%;
  height: 100%;
}

.start-screen {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  align-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background:
    linear-gradient(90deg, rgba(12, 22, 21, 0.82), rgba(12, 22, 21, 0.28) 58%, rgba(12, 22, 21, 0.58)),
    radial-gradient(circle at 75% 18%, rgba(240, 189, 108, 0.2), transparent 20rem);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.start-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  cursor: default;
  pointer-events: auto;
}

.title-ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.title-leaf,
.title-glow {
  position: absolute;
  display: block;
  opacity: 0;
}

.title-leaf {
  width: 2.1rem;
  height: 3.4rem;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(145deg, rgba(129, 162, 81, 0.72), rgba(35, 75, 53, 0.4));
  box-shadow: inset 0 0 0 1px rgba(247, 243, 223, 0.1);
  animation: title-leaf-drift 2.8s ease-out both;
}

.title-glow {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #ffe79a;
  box-shadow: 0 0 1rem 0.35rem rgba(255, 218, 116, 0.42);
  animation: title-glow-rise 2.3s ease-in-out both;
}

.leaf-one { top: 12%; left: 12%; transform: rotate(15deg); animation-delay: .05s; }
.leaf-two { top: 66%; left: 28%; transform: rotate(128deg) scale(.7); animation-delay: .25s; }
.leaf-three { top: 20%; left: 70%; transform: rotate(210deg) scale(.85); animation-delay: .42s; }
.glow-one { top: 31%; left: 44%; animation-delay: .72s; }
.glow-two { top: 58%; left: 64%; animation-delay: .95s; }
.glow-three { top: 19%; left: 82%; animation-delay: 1.15s; }

.title-block {
  position: relative;
  z-index: 1;
  animation: title-reveal 1.15s .45s both;
}

@keyframes title-reveal {
  from { opacity: 0; transform: translateY(1.3rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes title-leaf-drift {
  0% { opacity: 0; translate: -2rem -1.2rem; }
  30% { opacity: .76; }
  100% { opacity: 0; translate: 5rem 6rem; rotate: 34deg; }
}

@keyframes title-glow-rise {
  0% { opacity: 0; transform: translateY(.8rem) scale(.5); }
  35% { opacity: .95; }
  100% { opacity: 0; transform: translateY(-2.3rem) scale(1.25); }
}

.title-block {
  width: min(42rem, 100%);
  padding-left: clamp(0rem, 4vw, 3rem);
}

@media (prefers-reduced-motion: reduce) {
  .title-leaf,
  .title-glow,
  .title-block { animation: none; }
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--sun);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Spectral", Georgia, serif;
  line-height: 0.98;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(4rem, 13vw, 9.5rem);
}

h2 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
}

.intro {
  width: min(36rem, 100%);
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.field-row {
  display: grid;
  gap: 0.35rem;
  min-width: min(15rem, 100%);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field-row input,
.field-row select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--ink);
  background: rgba(20, 34, 33, 0.58);
  outline: none;
  text-transform: none;
}

.field-row select {
  cursor: pointer;
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.primary-button,
.secondary-button,
.danger-button,
.close-button,
.icon-button {
  min-height: 2.75rem;
  border-radius: 0.5rem;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.primary-button,
.secondary-button,
.danger-button {
  padding: 0.8rem 1rem;
  font-weight: 800;
}

.primary-button {
  color: #182220;
  background: var(--sun);
}

.secondary-button,
.icon-button,
.close-button {
  color: var(--ink);
  background: rgba(247, 243, 223, 0.13);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.danger-button {
  width: 100%;
  margin-top: 1rem;
  color: #fff8ed;
  background: rgba(206, 111, 117, 0.76);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.icon-button:hover,
.close-button:hover {
  transform: translateY(-1px);
}

.hud {
  position: absolute;
  z-index: 4;
  top: max(1rem, env(safe-area-inset-top));
  left: max(1rem, env(safe-area-inset-left));
  right: max(1rem, env(safe-area-inset-right));
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  pointer-events: none;
}

.hud-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(0.25rem, 1vw, 0.55rem);
  min-width: 0;
}

.hud-group-left {
  margin-right: auto;
}

.hud-group-right {
  margin-left: auto;
}

.hud-icon-button {
  width: clamp(2.75rem, 7vw, 3rem);
  height: clamp(2.75rem, 7vw, 3rem);
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(247, 243, 223, 0.14);
  border-radius: 1rem;
  background: rgba(25, 42, 40, 0.92);
  box-shadow: inset 0 1px 0 rgba(247, 243, 223, 0.05), 0 8px 22px rgba(0, 0, 0, 0.2);
  color: #e8dcb8;
  cursor: pointer;
  position: relative;
  pointer-events: auto;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.hud-icon-button:hover,
.hud-icon-button:focus-visible {
  transform: translateY(-1px);
  background: #263e3a;
  border-color: rgba(232, 220, 184, 0.34);
}

.hud-icon-button > span {
  display: block;
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  transform: scale(0.9);
}

.sound-button::before {
  content: "";
  width: 0.58rem;
  height: 0.7rem;
  position: absolute;
  left: calc(50% - 0.65rem);
  top: calc(50% - 0.35rem);
  background: #e8dcb8;
  clip-path: polygon(0 30%, 38% 30%, 100% 0, 100% 100%, 38% 70%, 0 70%);
}

.sound-button::after {
  content: "";
  width: 0.44rem;
  height: 0.82rem;
  position: absolute;
  left: calc(50% + 0.12rem);
  top: calc(50% - 0.41rem);
  border: 0.12rem solid #e8dcb8;
  border-left: 0;
  border-radius: 0 1rem 1rem 0;
}

.sound-button.is-muted::after {
  height: 0;
  border: 0;
  transform: rotate(45deg);
}

.sound-button.is-muted::before {
  opacity: 0.52;
}

.journal-button > span {
  width: 1.1rem;
  height: 0.92rem;
  border: 0.13rem solid #e8dcb8;
  border-radius: 0.13rem;
  box-shadow: 0.23rem -0.23rem 0 -0.08rem #243a37, 0.23rem -0.23rem 0 0.04rem #e8dcb8;
}

.journal-button > span::after {
  content: "";
  position: absolute;
  right: -0.03rem;
  top: -0.1rem;
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: #f0bd43;
  box-shadow: 0 0 0 0.16rem rgba(240, 189, 67, 0.14);
}

.customize-button > span::before {
  content: "";
  position: absolute;
  left: 0.46rem;
  top: 0.08rem;
  width: 0.34rem;
  height: 0.34rem;
  border: 0.12rem solid #e8dcb8;
  border-radius: 50%;
}

.customize-button > span::after {
  content: "";
  position: absolute;
  left: 0.14rem;
  bottom: 0.08rem;
  width: 0.95rem;
  height: 0.55rem;
  border: 0.12rem solid #e8dcb8;
  border-radius: 0.7rem 0.7rem 0.18rem 0.18rem;
}

.options-button > span {
  font-size: 1.48rem;
  line-height: 1;
}

.info-button > span {
  width: 1.18rem;
  height: 1.18rem;
  border: 0.13rem solid #e8dcb8;
  border-radius: 50%;
  font: 800 0.86rem/1.02 Nunito, sans-serif;
  text-align: center;
}

.pause-button {
  border-color: rgba(240, 189, 67, 0.42);
}

.pause-button > span::before,
.pause-button > span::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  width: 0.28rem;
  height: 0.95rem;
  border-radius: 0.12rem;
  background: #f0bd43;
}

.pause-button > span::before { left: 0.34rem; }
.pause-button > span::after { right: 0.34rem; }

.icon-button,
.sound-button:not(.hud-icon-button),
.fullscreen-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0 0.8rem;
  border-radius: 0.5rem;
  background: rgba(20, 34, 33, 0.64);
  border: 1px solid rgba(247, 243, 223, 0.16);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.icon-button {
  pointer-events: auto;
}

.sound-button:not(.hud-icon-button),
.fullscreen-button {
  width: 2.55rem;
  padding: 0;
  color: transparent;
  pointer-events: auto;
  position: relative;
}

.fullscreen-button {
  display: none;
}

.sound-button:not(.hud-icon-button)::before {
  content: "";
  width: 1.28rem;
  height: 1.28rem;
  background: var(--ink);
  clip-path: polygon(5% 36%, 33% 36%, 68% 8%, 68% 92%, 33% 64%, 5% 64%);
}

.sound-button:not(.hud-icon-button)::after {
  content: "";
  position: absolute;
  right: 0.48rem;
  width: 0.48rem;
  height: 0.82rem;
  border: 2px solid var(--ink);
  border-left: 0;
  border-top-right-radius: 1rem;
  border-bottom-right-radius: 1rem;
}

.sound-button.is-muted::before {
  opacity: 0.62;
}

.sound-button.is-muted::after {
  right: 0.56rem;
  width: 1rem;
  height: 2px;
  border: 0;
  border-radius: 0;
  background: var(--berry);
  transform: rotate(-42deg);
}

.fullscreen-button::before,
.fullscreen-button::after {
  content: "";
  position: absolute;
  inset: 0.68rem;
  border: 2px solid var(--ink);
}

.fullscreen-button::before {
  border-right: 0;
  border-bottom: 0;
}

.fullscreen-button::after {
  border-left: 0;
  border-top: 0;
}

.message {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
  width: min(34rem, calc(100% - 2rem));
  padding: 0.95rem 1rem;
  border-radius: 0.5rem;
  background: rgba(20, 34, 33, 0.78);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: center;
  line-height: 1.45;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
}

.message.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.message.is-discovery {
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  box-shadow: none;
}

.mission-tracker {
  position: absolute;
  z-index: 4;
  left: 1rem;
  top: 4.4rem;
  width: min(20rem, calc(100% - 2rem));
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 0.95rem;
  overflow: hidden;
  border-radius: 0.3rem 0.65rem 0.8rem 0.42rem;
  border: 1px solid rgba(128, 85, 47, 0.52);
  background: linear-gradient(115deg, transparent 0 71%, rgba(116, 78, 39, 0.07) 71% 73%, transparent 73%), #ead7a7;
  box-shadow: inset 0 0 0 3px rgba(116, 78, 39, 0.1), 0 12px 34px rgba(0, 0, 0, 0.2);
  color: #3f4d3c;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.5rem);
  transition: opacity 0.32s ease, transform 0.32s ease, visibility 0s linear 0.32s;
}

.mission-tracker.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.mission-tracker strong {
  padding-right: 2rem;
  color: #315a42;
  font-family: "Spectral", Georgia, serif;
  font-size: 1.1rem;
}

.mission-tracker span {
  min-width: 0;
}

.mission-tracker::after {
  content: "✿";
  position: absolute;
  right: 0.62rem;
  top: 0.48rem;
  color: #d49369;
  font-size: 1.75rem;
  line-height: 1;
  text-shadow: 0 0 0 #9db65e, -0.62rem 1.15rem 0 #6b974f;
}

.version-badge {
  position: absolute;
  right: max(0.8rem, env(safe-area-inset-right));
  bottom: max(0.65rem, env(safe-area-inset-bottom));
  z-index: 3;
  padding: 0.28rem 0.48rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(247, 243, 223, 0.14);
  color: rgba(247, 243, 223, 0.62);
  background: rgba(20, 34, 33, 0.42);
  font-size: 0.72rem;
  font-weight: 800;
  pointer-events: none;
}

.cinematic {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(7, 10, 12, 0.88);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.cinematic.is-visible {
  opacity: 1;
  visibility: visible;
}

.cinematic-frame {
  width: min(44rem, 100%);
  min-height: 14rem;
  display: grid;
  place-items: center;
  padding: clamp(1.2rem, 5vw, 3rem);
  border-top: 1px solid rgba(247, 243, 223, 0.32);
  border-bottom: 1px solid rgba(247, 243, 223, 0.32);
  text-align: center;
}

.cinematic-frame p {
  margin: 0;
  font-family: "Spectral", Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 4rem);
  line-height: 1.08;
}

.mobile-pad {
  position: absolute;
  z-index: 4;
  left: max(1.1rem, calc(env(safe-area-inset-left) + 0.9rem));
  bottom: max(1.1rem, calc(env(safe-area-inset-bottom) + 0.9rem));
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  border: 1px solid rgba(247, 243, 223, 0.16);
  background: rgba(247, 243, 223, 0.08);
  backdrop-filter: blur(12px);
  display: none;
  touch-action: none;
}

.mobile-pad::before,
.mobile-pad::after {
  content: "";
  position: absolute;
  inset: 1.05rem;
  border-radius: 50%;
  pointer-events: none;
}

.mobile-pad::before {
  border: 1px solid rgba(247, 243, 223, 0.1);
}

.mobile-pad::after {
  inset: 0.42rem;
  border: 1px dashed rgba(240, 189, 108, 0.12);
}

.pad-action {
  position: absolute;
  z-index: 3;
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(247, 243, 223, 0.15);
  color: rgba(247, 243, 223, 0.68);
  background: rgba(20, 34, 33, 0.28);
  font-size: 1rem;
  line-height: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
}

.pad-action:active,
.pad-action.is-active {
  color: #fff3bc;
  border-color: rgba(240, 189, 108, 0.48);
  background: rgba(240, 189, 108, 0.24);
  box-shadow: 0 0 18px rgba(240, 189, 108, 0.24);
  transform: translate(-50%, -50%);
}

.pad-mode-shell {
  position: absolute;
  z-index: 4;
  left: 0.82rem;
  top: 50%;
  transform: translate(-50%, -50%);
}

.pad-action-mode {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
}

.pad-action-mode:active,
.pad-action-mode.is-active {
  transform: none;
}

.control-icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.control-icon { display: block; width: 1.5rem; height: 1.5rem; pointer-events: none; }

.pad-action-jump {
  left: 50%;
  top: -0.2rem;
}

.pad-action-jump .control-icon {
  width: 1.2rem;
  height: 1.2rem;
}

.pad-action-companion {
  left: calc(100% - 0.82rem);
  top: 50%;
}

.pad-action-companion.is-hidden {
  opacity: 0.46;
  color: rgba(247, 243, 223, 0.44);
  box-shadow: inset 0 0 0 1px rgba(247, 243, 223, 0.08);
}

.pad-action-companion.is-locked {
  color: rgba(247, 243, 223, 0.5);
}

.mobile-pad.is-jump .pad-action-jump,
.guide-pad.is-jump .pad-action-jump {
  color: #fff3bc;
  background: rgba(240, 189, 108, 0.24);
  box-shadow: 0 0 18px rgba(240, 189, 108, 0.28);
  transform: translate(-50%, -50%);
}

.pad-knob {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(240, 189, 108, 0.9);
  transform: translate(-50%, -50%);
}

.parchment-dialog[open] {
  width: min(42rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  color: #302317;
  background: #edd9a6;
  border: 3px solid #a88850;
  border-radius: 13px 7px 16px 9px;
  box-shadow: inset 0 0 22px #ad85444d, 0 12px 35px #0006;
  overflow: hidden;
  animation: parchment-unroll .42s ease-out both;
}
.parchment-dialog[open] form {
  display: flex; flex-direction: column; gap: .8rem;
  max-height: calc(100dvh - 2rem); box-sizing: border-box;
  padding: 1.2rem 4rem 1.2rem 1.2rem;
  overflow: auto;
  background: repeating-linear-gradient(3deg, #8b642008 0 1px, transparent 1px 5px), #edd9a6;
}
.parchment-dialog form::after, .parchment-dialog form::before,
.parchment-dialog .mission-poster-botany, .parchment-dialog .mission-poster-pin,
.parchment-dialog .mission-poster::before, .parchment-dialog .mission-poster::after { display: none; }
.parchment-dialog .mission-poster { padding: .25rem; background: none; border: 0; box-shadow: none; transform: none; overflow: visible; }
.parchment-dialog .panel-header { padding: 0; flex-shrink: 0; }
.parchment-dialog .mission-body, .parchment-dialog .dialog-copy { overflow: auto; min-height: 0; }
.parchment-dialog p, .parchment-dialog strong, .parchment-dialog small,
.parchment-dialog .dialog-copy, .parchment-dialog .mission-poster-hint b { color: #302317; opacity: 1; font-family: Nunito, sans-serif; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.parchment-dialog h2, .parchment-dialog h3 { color: #382a19; font-family: Spectral, Georgia, serif; line-height: 1.2; }
.parchment-dialog .choice-actions, .parchment-dialog .dialog-choice-list { flex-shrink: 0; }
.parchment-dialog button { min-height: 44px; color: #302317; background: #fff2cf; border: 1px solid #876e42; white-space: normal; }
.parchment-dialog button:focus-visible { outline: 3px solid #385b35; outline-offset: 2px; }
.parchment-quill { position: absolute; right: .55rem; top: 4rem; width: 2.5rem; pointer-events: none; transform: rotate(10deg); }
.parchment-quill svg { width: 100%; height: auto; }
.parchment-dialog[open] .mission-body, .parchment-dialog[open] .dialog-copy { animation: parchment-ink .42s ease-out both; }
.parchment-dialog.is-rolling-up { animation: parchment-unroll .22s ease-in reverse both; }
@keyframes parchment-unroll { from { clip-path: inset(48% 0 round 12px); } to { clip-path: inset(0 round 8px); } }
@keyframes parchment-ink { 0%, 55% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .parchment-dialog[open], .parchment-dialog[open] .mission-body, .parchment-dialog[open] .dialog-copy { animation: none; }
}

.panel-dialog {
  width: min(34rem, calc(100vw - 1.4rem));
  max-height: min(44rem, calc(100dvh - 1.4rem));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.panel-dialog::backdrop {
  background: rgba(7, 12, 12, 0.58);
  backdrop-filter: blur(5px);
}

.panel-dialog.is-fallback-open {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
}

.panel-dialog form {
  padding: 1rem;
  max-height: calc(100dvh - 1.4rem);
  overflow: auto;
}

#journalDialog {
  width: min(68rem, calc(100vw - 1.4rem));
}

.customize-dialog {
  width: min(48rem, calc(100vw - 1.4rem));
}

.customize-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) 1fr;
  gap: 1rem;
  align-items: start;
}

.custom-preview {
  min-height: 18rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 189, 108, 0.22);
  border-radius: 0.5rem;
  background:
    linear-gradient(180deg, rgba(103, 180, 200, 0.16), rgba(142, 191, 118, 0.11)),
    rgba(247, 243, 223, 0.06);
}

.custom-preview canvas {
  width: min(13.75rem, 100%);
  height: auto;
}

.appearance-choices {
  display: grid;
  gap: 0.85rem;
}

.appearance-choice-group {
  display: grid;
  gap: 0.45rem;
}

.appearance-choice-group h3 {
  margin: 0;
  color: var(--sun);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.appearance-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.appearance-choice {
  min-width: 5.8rem;
  min-height: 4rem;
  display: grid;
  place-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--ink);
  background: rgba(247, 243, 223, 0.08);
  font-weight: 850;
  font-size: 0.78rem;
  line-height: 1.12;
  text-align: center;
}

.appearance-choice.is-selected {
  border-color: rgba(240, 189, 108, 0.82);
  background: rgba(240, 189, 108, 0.18);
}

.appearance-choice:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.appearance-choice small {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.1;
}

.appearance-swatch,
.appearance-icon {
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(247, 243, 223, 0.42);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(20, 34, 33, 0.2);
}

.appearance-icon {
  border-radius: 0.45rem;
  background: rgba(20, 34, 33, 0.42);
  color: var(--sun);
  font-size: 0.72rem;
}

.customize-name {
  margin-top: 1rem;
}

.customize-actions {
  justify-content: flex-end;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.close-button {
  padding: 0 0.75rem;
}

.journal-list {
  display: grid;
  gap: 0.9rem;
  max-height: min(34rem, calc(100dvh - 8rem));
  overflow: auto;
  padding-right: 0.25rem;
}

.journal-item {
  padding: 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: rgba(247, 243, 223, 0.08);
}

.journal-item strong {
  display: block;
  color: var(--sun);
  margin-bottom: 0.25rem;
}

.journal-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.journal-summary {
  background: rgba(240, 189, 108, 0.12);
}

.journal-book {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.journal-page {
  min-height: 20rem;
  padding: 1rem;
  border: 1px solid rgba(88, 61, 33, 0.28);
  border-radius: 0.5rem;
  background:
    linear-gradient(90deg, rgba(247, 243, 223, 0.13), rgba(247, 243, 223, 0.04)),
    rgba(240, 189, 108, 0.08);
}

.journal-page h3,
.journal-section h3 {
  margin: 0 0 0.75rem;
  color: var(--sun);
  font-family: "Spectral", Georgia, serif;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.journal-kicker {
  margin: 0 0 0.35rem;
  color: rgba(247, 243, 223, 0.55);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.journey-stamps,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.journey-stamps span,
.stat-grid span {
  padding: 0.55rem;
  border-radius: 0.5rem;
  background: rgba(20, 34, 33, 0.35);
  color: var(--muted);
  line-height: 1.25;
}

.stat-grid strong {
  display: block;
  color: var(--sun);
  font-size: 1.1rem;
}

.journey-note,
.last-meeting,
.empty-note {
  margin: 0.85rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.journal-landscape {
  height: 7rem;
  display: grid;
  place-items: center;
  margin-top: 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(247, 243, 223, 0.14);
  background: linear-gradient(180deg, rgba(103, 180, 200, 0.42), rgba(142, 191, 118, 0.28) 62%, rgba(79, 62, 38, 0.42));
  color: var(--ink);
  font-size: 3rem;
  font-weight: 900;
}

.season-automne {
  background: linear-gradient(180deg, rgba(206, 111, 117, 0.28), rgba(240, 189, 108, 0.22));
}

.season-hiver {
  background: linear-gradient(180deg, rgba(103, 180, 200, 0.24), rgba(247, 243, 223, 0.16));
}

.season-ete {
  background: linear-gradient(180deg, rgba(240, 189, 108, 0.28), rgba(103, 180, 200, 0.2));
}

.daily-sketch {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  gap: 0.85rem;
  align-items: center;
}

.daily-sketch p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.journal-section {
  display: grid;
  gap: 0.75rem;
}

.journal-card {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  gap: 0.85rem;
}

.journal-object-image {
  width: 4.6rem;
  height: 4.6rem;
  display: grid;
  place-items: center;
  border-radius: 0.5rem;
  border: 1px solid rgba(240, 189, 108, 0.28);
  background: rgba(240, 189, 108, 0.13);
  color: var(--sun);
  font-size: 1.6rem;
  font-weight: 900;
}

.journal-object-image.large {
  width: 5.6rem;
  height: 5.6rem;
  font-size: 2rem;
}

.item-icon {
  position: relative;
  width: 3.2rem;
  height: 3.2rem;
  display: block;
}

.object-visual {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.item-icon.small {
  width: 3.2rem;
  height: 3.2rem;
  flex: 0 0 auto;
  margin: -0.55rem;
  transform: scale(0.68);
  transform-origin: center;
}

.item-icon.large {
  width: 3.2rem;
  height: 3.2rem;
  transform: scale(1.24);
  transform-origin: center;
}

.item-shape {
  position: absolute;
  display: block;
}

.item-icon-leaf .item-shape-main {
  left: 0.65rem;
  top: 0.45rem;
  width: 1.75rem;
  height: 2.35rem;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, #9fbd56, #4f8763);
  transform: rotate(-32deg);
}

.item-icon-leaf .item-shape-detail {
  left: 1.5rem;
  top: 0.6rem;
  width: 0.12rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(247, 243, 223, 0.65);
  transform: rotate(-32deg);
}

.item-icon-stone .item-shape-main {
  left: 0.45rem;
  top: 1rem;
  width: 2.35rem;
  height: 1.65rem;
  border-radius: 48% 56% 44% 52%;
  background: linear-gradient(135deg, #b7b2a3, #6f756f);
  box-shadow: inset -0.25rem -0.22rem 0 rgba(38, 47, 45, 0.22);
}

.item-icon-stone .item-shape-detail {
  left: 1rem;
  top: 1.25rem;
  width: 0.8rem;
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(247, 243, 223, 0.45);
  transform: rotate(-18deg);
}

.item-icon-feather .item-shape-main {
  left: 1.35rem;
  top: 0.35rem;
  width: 0.8rem;
  height: 2.65rem;
  border-radius: 80% 20% 80% 20%;
  background: linear-gradient(135deg, #f7f3df, #67b4c8);
  transform: rotate(28deg);
}

.item-icon-feather .item-shape-detail {
  left: 1.58rem;
  top: 0.55rem;
  width: 0.1rem;
  height: 2.3rem;
  border-radius: 999px;
  background: rgba(38, 49, 46, 0.46);
  transform: rotate(28deg);
}

.item-icon-shell .item-shape-main {
  left: 0.5rem;
  top: 0.9rem;
  width: 2.25rem;
  height: 1.75rem;
  border-radius: 55% 55% 42% 42%;
  background: radial-gradient(circle at 50% 28%, #f7f3df 0 16%, #e8d49a 17% 55%, #c98a68 56%);
}

.item-icon-shell .item-shape-detail {
  left: 1.55rem;
  top: 0.95rem;
  width: 0.12rem;
  height: 1.55rem;
  border-radius: 999px;
  background: rgba(139, 104, 64, 0.45);
  box-shadow: -0.48rem 0.1rem 0 rgba(139, 104, 64, 0.26), 0.48rem 0.1rem 0 rgba(139, 104, 64, 0.26);
}

.item-icon-cone .item-shape-main {
  left: 0.8rem;
  top: 0.45rem;
  width: 1.65rem;
  height: 2.4rem;
  border-radius: 48% 48% 55% 55%;
  background: linear-gradient(180deg, #b76b45, #6f4729);
}

.item-icon-cone .item-shape-detail {
  left: 0.95rem;
  top: 0.85rem;
  width: 1.35rem;
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(247, 243, 223, 0.3);
  box-shadow: 0 0.55rem 0 rgba(247, 243, 223, 0.24), 0 1.1rem 0 rgba(247, 243, 223, 0.18);
}

.item-icon-mushroom .item-shape-main {
  left: 0.45rem;
  top: 0.55rem;
  width: 2.35rem;
  height: 1.25rem;
  border-radius: 1.25rem 1.25rem 0.35rem 0.35rem;
  background: linear-gradient(180deg, #d65f76, #9f3f62);
  box-shadow: 0 0 1rem rgba(255, 229, 118, 0.28);
}

.item-icon-mushroom .item-shape-detail {
  left: 1.25rem;
  top: 1.55rem;
  width: 0.75rem;
  height: 1.35rem;
  border-radius: 0.35rem;
  background: #ead68d;
}

.item-icon-mushroom .item-shape-accent {
  left: 0.95rem;
  top: 0.82rem;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: #f7f3df;
  box-shadow: 0.72rem -0.08rem 0 #f7f3df, 1.08rem 0.34rem 0 #f7f3df;
}

.item-icon-star .item-shape-main {
  left: 0.45rem;
  top: 0.38rem;
  width: 2.35rem;
  height: 2.35rem;
  background: #f6cf36;
  clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 56%, 79% 92%, 50% 70%, 21% 92%, 32% 56%, 2% 35%, 39% 34%);
  filter: drop-shadow(0 0 0.55rem rgba(246, 207, 54, 0.45));
}

.item-icon-flower .item-shape-main {
  left: 0.75rem;
  top: 0.55rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #eaa0b0;
  box-shadow: -0.42rem 0.38rem 0 #ce6f75, 0.42rem 0.38rem 0 #ce6f75, 0 -0.42rem 0 #f2c4c9, 0 0.6rem 0 #d9899a;
}

.item-icon-flower .item-shape-detail {
  left: 1.42rem;
  top: 1.22rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #f6cf36;
}

.item-icon-paper .item-shape-main {
  left: 0.75rem;
  top: 0.45rem;
  width: 1.8rem;
  height: 2.35rem;
  border-radius: 0.18rem;
  background: #e8d49a;
  transform: rotate(-7deg);
}

.item-icon-paper .item-shape-detail {
  left: 1.1rem;
  top: 1.05rem;
  width: 1.08rem;
  height: 0.12rem;
  border-radius: 999px;
  background: rgba(139, 104, 64, 0.55);
  box-shadow: 0 0.45rem 0 rgba(139, 104, 64, 0.38);
  transform: rotate(-7deg);
}

.item-icon-tool .item-shape-main,
.item-icon-charm .item-shape-main {
  left: 0.75rem;
  top: 0.75rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.38rem;
  background: linear-gradient(135deg, #f0bd6c, #8b6840);
  transform: rotate(45deg);
}

.item-icon-rare .item-shape-main {
  left: 0.56rem;
  top: 0.45rem;
  width: 2.1rem;
  height: 2.35rem;
  background: linear-gradient(160deg, #67b4c8, #f0bd6c);
  clip-path: polygon(50% 0, 92% 28%, 72% 100%, 28% 100%, 8% 28%);
  filter: drop-shadow(0 0 0.45rem rgba(103, 180, 200, 0.35));
}

.item-icon-rare .item-shape-detail {
  left: 1.35rem;
  top: 0.78rem;
  width: 0.55rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(247, 243, 223, 0.36);
  transform: rotate(24deg);
}

.item-icon-unknown {
  display: grid;
  place-items: center;
  color: rgba(247, 243, 223, 0.55);
  font-size: 1.7rem;
  font-weight: 900;
}

.encyclopedia-grid,
.villager-grid,
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem;
}

.encyclopedia-card,
.villager-card,
.achievement-card,
.quest-card,
.review-list article,
.map-zone {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(247, 243, 223, 0.07);
  color: var(--muted);
}

.villager-card p,
.encyclopedia-card p,
.achievement-card p,
.quest-card p,
.review-list p {
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.encyclopedia-card strong,
.villager-card strong,
.achievement-card strong,
.quest-card strong,
.review-list strong {
  color: var(--ink);
}

.encyclopedia-card,
.villager-card,
.achievement-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
}

.encyclopedia-card.is-known {
  cursor: pointer;
}

.encyclopedia-card.is-known:hover,
.encyclopedia-card.is-known:focus-visible {
  border-color: rgba(240, 189, 108, 0.55);
  background: rgba(240, 189, 108, 0.12);
  outline: none;
}

.encyclopedia-card.is-unknown,
.villager-card.is-unknown,
.achievement-card.is-unknown,
.map-zone.is-fog {
  filter: grayscale(1);
  opacity: 0.62;
}

.encyclopedia-card.is-unknown .journal-object-image {
  background: rgba(0, 0, 0, 0.28);
  color: rgba(247, 243, 223, 0.42);
}

.villager-portrait,
.companion-portrait {
  width: 3.7rem;
  height: 3.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(240, 189, 108, 0.25);
  background: rgba(240, 189, 108, 0.12);
  color: var(--sun);
  font-size: 1.35rem;
  font-weight: 900;
}

.companion-portrait {
  width: 5rem;
  height: 5rem;
  border-radius: 0.5rem;
  font-size: 1.8rem;
}

.companion-card {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(247, 243, 223, 0.07);
  color: var(--muted);
}

.companion-card p {
  margin: 0.25rem 0 0;
  line-height: 1.45;
}

.companion-card strong {
  color: var(--ink);
}

.companion-toggle-button {
  width: fit-content;
  margin-top: 0.45rem;
}

.travel-map {
  min-height: 14rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, rgba(103, 180, 200, 0.14), rgba(142, 191, 118, 0.12));
}

.map-zone {
  display: grid;
  place-items: center;
  padding: 0.8rem;
  text-align: center;
}

.map-zone span {
  color: var(--sun);
  font-size: 1.6rem;
  font-weight: 900;
}

.quest-card {
  padding: 0.8rem;
}

.progress-bar {
  height: 0.7rem;
  overflow: hidden;
  margin: 0.65rem 0 0.2rem;
  border-radius: 999px;
  background: rgba(247, 243, 223, 0.12);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--sun);
}

.review-list {
  display: grid;
  gap: 0.55rem;
}

.review-list article {
  padding: 0.7rem 0.85rem;
}

.album-section p + p {
  margin-top: 0.35rem;
}

.album-section span {
  color: var(--ink);
  font-weight: 900;
}

.compact-dialog {
  width: min(30rem, calc(100vw - 1.4rem));
}

.dialog-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.dialog-choice-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.dialog-choice-list[hidden] {
  display: none;
}

.dialog-choice-button {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(240, 189, 108, 0.28);
  border-radius: 0.55rem;
  background: rgba(247, 243, 223, 0.08);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.dialog-choice-button:hover,
.dialog-choice-button:focus-visible {
  border-color: rgba(240, 189, 108, 0.62);
  background: rgba(240, 189, 108, 0.16);
}

.is-reward-pending .close-button {
  display: none;
}

.is-choice-pending .close-button {
  display: none;
}

.mission-complete-mark {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  margin: 0 auto 0.65rem;
  border-radius: 50%;
  color: #20312f;
  background: #f0bd6c;
  box-shadow: 0 0 0 0.45rem rgba(240, 189, 108, 0.13);
  font-size: 1.7rem;
  font-weight: 900;
  animation: reward-arrival 0.46s ease both;
}

.mission-complete-thanks {
  text-align: center;
}

.mission-reward-list-celebration li {
  animation: reward-arrival 0.42s ease both;
}

.mission-reward-list-celebration li:nth-child(2) {
  animation-delay: 0.1s;
}

.item-use-actions {
  margin-top: 0.25rem;
}

.companion-select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.9rem 0;
}

.companion-select-option {
  min-height: 7.1rem;
  display: grid;
  place-items: center;
  gap: 0.18rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--ink);
  background: rgba(247, 243, 223, 0.08);
  font: inherit;
  cursor: pointer;
}

.companion-select-option .companion-portrait {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 0.9rem;
}

.companion-select-option small {
  color: var(--muted);
  font-size: 0.68rem;
}

.companion-select-option.is-selected {
  border-color: rgba(240, 189, 108, 0.78);
  background: rgba(240, 189, 108, 0.16);
}

@keyframes reward-arrival {
  from { opacity: 0; transform: translateY(0.4rem) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.discovery-body {
  display: grid;
  gap: 0.6rem;
  color: var(--muted);
  line-height: 1.55;
}

.discovery-body p {
  margin: 0;
}

.discovery-body strong {
  color: var(--sun);
}

.discovery-popup-item {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem;
  border: 1px solid rgba(240, 189, 108, 0.24);
  border-radius: 0.55rem;
  background: rgba(247, 243, 223, 0.06);
}

.discovery-popup-item .item-icon { justify-self: center; }
.discovery-popup-item p, .discovery-popup-note { margin: 0.32rem 0 0; line-height: 1.42; }
.discovery-popup-note { color: var(--sun); font-size: 0.88rem; text-align: center; }

.discovery-paper-dialog {
  border-color: rgba(128, 85, 47, 0.62);
  border-radius: 0.32rem 0.75rem 1.25rem 0.58rem;
  color: #3e4b3c;
  background: #ead7a7;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.38), inset 0 0 0 4px rgba(122, 84, 45, 0.11);
}

.discovery-paper-dialog form {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(124deg, transparent 0 73%, rgba(118, 78, 41, 0.07) 73% 75%, transparent 75%),
    radial-gradient(circle at 12% 10%, rgba(255, 250, 215, 0.92), transparent 24rem);
}

.discovery-paper-dialog form::before {
  content: "❀";
  position: absolute;
  right: 1.15rem;
  top: 0.88rem;
  color: #cf8d6c;
  font-size: 2.1rem;
  line-height: 1;
  text-shadow: -0.75rem 1.28rem 0 #769957, -1.28rem 1.82rem 0 #a7bc68;
  opacity: 0.9;
  pointer-events: none;
}

.discovery-paper-dialog .panel-header { position: relative; z-index: 1; padding-right: 3.2rem; border-bottom-color: rgba(93, 66, 37, 0.26); }
.discovery-paper-dialog .panel-header h2 { color: #315a42; font-family: "Spectral", Georgia, serif; }
.discovery-paper-dialog .close-button { border-color: rgba(101, 76, 47, 0.42); color: #4b6044; background: rgba(255, 247, 212, 0.48); }
.discovery-paper-dialog .discovery-body { position: relative; z-index: 1; color: #495746; }
.discovery-paper-dialog .discovery-body strong { color: #315a42; }
.discovery-paper-dialog .discovery-popup-item { border-color: rgba(105, 126, 70, 0.4); background: rgba(255, 248, 215, 0.38); }
.discovery-paper-dialog .discovery-popup-note { color: #765131; font-weight: 800; }
.discovery-paper-dialog .check-row { position: relative; z-index: 1; color: #5d664f; }
.discovery-paper-dialog .choice-actions { position: relative; z-index: 1; }

.villager-paper-dialog {
  border-color: rgba(115, 83, 46, 0.6);
  border-radius: 0.58rem 0.3rem 1.1rem 0.76rem;
  color: #3e4b3c;
  background: #ead7a7;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.38), inset 0 0 0 4px rgba(122, 84, 45, 0.1);
}

.villager-paper-dialog form {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(55deg, transparent 0 76%, rgba(118, 78, 41, 0.07) 76% 78%, transparent 78%),
    radial-gradient(circle at 10% 12%, rgba(255, 250, 215, 0.9), transparent 22rem);
}

.villager-paper-dialog form::after {
  content: "❀";
  position: absolute;
  right: 1.1rem;
  top: 0.8rem;
  color: #d48669;
  font-size: 2.05rem;
  line-height: 1;
  text-shadow: -0.7rem 1.25rem 0 #6d9753, -1.22rem 1.8rem 0 #a7ba69;
  pointer-events: none;
}

.villager-paper-dialog .panel-header { position: relative; z-index: 1; padding-right: 3.1rem; border-bottom-color: rgba(93, 66, 37, 0.26); }
.villager-paper-dialog .panel-header h2 { color: #315a42; font-family: "Spectral", Georgia, serif; }
.villager-paper-dialog .close-button { border-color: rgba(101, 76, 47, 0.42); color: #4b6044; background: rgba(255, 247, 212, 0.48); }
.villager-paper-dialog .dialog-copy { position: relative; z-index: 1; color: #465642; font-family: "Spectral", Georgia, serif; font-size: 1.12rem; line-height: 1.52; }
.villager-paper-dialog .dialog-choice-list, .villager-paper-dialog .choice-actions { position: relative; z-index: 1; }
.villager-paper-dialog .dialog-choice-button { border-color: rgba(94, 124, 70, 0.46); color: #38563e; background: rgba(255, 248, 215, 0.52); }
.villager-paper-dialog .dialog-choice-button:hover, .villager-paper-dialog .dialog-choice-button:focus-visible { background: rgba(229, 208, 146, 0.68); }

.mission-dialog h2 {
  font-size: clamp(1.65rem, 5vw, 2.35rem);
}

.mission-body {
  display: grid;
  gap: 0.7rem;
  color: var(--muted);
  line-height: 1.55;
}

.mission-body p {
  margin: 0;
}

.mission-body strong {
  color: var(--sun);
}

.mission-poster {
  position: relative;
  display: grid;
  gap: 0.9rem;
  overflow: hidden;
  padding: 1.4rem 4.2rem 1.15rem 1.2rem;
  border: 1px solid rgba(240, 189, 108, 0.48);
  border-radius: 0.55rem 0.55rem 1.15rem 0.7rem;
  color: #344137;
  background:
    linear-gradient(110deg, transparent 0 68%, rgba(134, 91, 50, 0.06) 68% 70%, transparent 70%),
    radial-gradient(circle at 12% 14%, rgba(255, 251, 220, 0.8), transparent 20%),
    #e9d7a7;
  box-shadow: inset 0 0 0 4px rgba(117, 79, 47, 0.1), 0 10px 22px rgba(0, 0, 0, 0.18);
  transform: rotate(-0.45deg);
}

.mission-poster::before,
.mission-poster::after {
  content: "";
  position: absolute;
  width: 5.4rem;
  height: 5.4rem;
  border: 1px solid rgba(62, 102, 66, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.mission-poster::before { right: -2.9rem; top: -2.9rem; }
.mission-poster::after { left: -3.4rem; bottom: -3.4rem; }
.mission-poster-pin { position: absolute; left: 50%; top: 0.6rem; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: #a95942; box-shadow: 0 1px 2px rgba(33, 22, 16, 0.36); }
.mission-poster-botany { position: absolute; z-index: 1; right: 0.35rem; top: 2.8rem; width: 3.55rem; height: 11.4rem; pointer-events: none; transform: rotate(4deg); }
.poster-stem { position: absolute; left: 1.72rem; top: 0.55rem; width: 0.16rem; height: 10rem; border-radius: 99px; background: linear-gradient(#466f42, #79914b); transform: rotate(13deg); transform-origin: top; }
.poster-leaf { position: absolute; width: 1.23rem; height: 2.05rem; border-radius: 100% 0 100% 0; background: linear-gradient(130deg, #a3bd62, #4b7a46); box-shadow: inset 0 0 0 1px rgba(241, 234, 169, 0.24); }
.poster-leaf::after { content: ""; position: absolute; left: 48%; top: 0.17rem; width: 1px; height: 1.7rem; background: rgba(241, 237, 181, 0.45); transform: rotate(-42deg); transform-origin: top; }
.poster-leaf-one { left: 0.18rem; top: 3.45rem; transform: rotate(-48deg); }
.poster-leaf-two { right: 0.1rem; top: 5.45rem; transform: rotate(125deg) scale(.88); }
.poster-leaf-three { left: 0.42rem; top: 7.52rem; transform: rotate(-34deg) scale(.73); }
.poster-flower { position: absolute; left: 0.42rem; top: 0; width: 2.3rem; height: 2.3rem; }
.poster-flower b { position: absolute; left: 0.78rem; top: 0.78rem; width: 0.76rem; height: 0.76rem; border-radius: 100% 0 100% 0; background: linear-gradient(145deg, #fff0b5, #e8ba71); transform-origin: 0 0; box-shadow: inset 0 0 0 1px rgba(166, 104, 53, 0.12); }
.poster-flower b:nth-child(1) { transform: rotate(0deg); }.poster-flower b:nth-child(2) { transform: rotate(72deg); }.poster-flower b:nth-child(3) { transform: rotate(144deg); }.poster-flower b:nth-child(4) { transform: rotate(216deg); }.poster-flower b:nth-child(5) { transform: rotate(288deg); }
.poster-flower em { position: absolute; left: 0.93rem; top: 0.93rem; width: 0.47rem; height: 0.47rem; border-radius: 50%; background: #b97836; box-shadow: 0 0 0 0.13rem rgba(255, 230, 142, 0.45); }
.mission-poster-header { display: grid; justify-items: center; gap: 0.15rem; padding: 0.3rem 1.1rem 0.7rem; text-align: center; border-bottom: 1px solid rgba(87, 62, 37, 0.26); }
.mission-poster-header span { color: #9d7141; font-size: 1.2rem; }
.mission-poster-header p, .mission-poster-header h3 { margin: 0; }
.mission-poster-header p, .mission-poster-objective > span, .mission-poster footer > span { color: #765131; font-size: 0.66rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.mission-poster-header h3 { color: #2c493b; font-family: "Spectral", Georgia, serif; font-size: 1.65rem; line-height: 1.05; }
.mission-poster-copy { margin: 0; text-align: center; line-height: 1.45; }
.mission-poster-objective { display: grid; justify-items: center; gap: 0.28rem; padding: 0.72rem; border: 1px dashed rgba(88, 106, 57, 0.48); border-radius: 0.35rem; background: rgba(255, 247, 208, 0.38); text-align: center; }
.mission-poster-objective strong { color: #315a42; }
.mission-poster-progress { width: min(13rem, 82%); height: 0.38rem; overflow: hidden; border-radius: 99px; background: rgba(66, 77, 45, 0.18); }
.mission-poster-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #83a64a, #d09a3d); }
.mission-poster-objective small { color: #6e5738; font-weight: 800; }
.mission-poster-hint { margin: 0; padding-left: 0.7rem; border-left: 3px solid rgba(115, 146, 70, 0.75); font-size: 0.9rem; line-height: 1.4; }
.mission-poster-hint b { display: block; color: #4e773f; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }
.mission-poster footer { display: grid; justify-items: center; gap: 0.15rem; padding-top: 0.2rem; text-align: center; }
.mission-poster footer strong { color: #855c2f; font-family: "Spectral", Georgia, serif; }

@media (max-width: 390px) {
  .mission-poster { padding-right: 3.55rem; }
  .mission-poster-botany { right: -0.12rem; transform: scale(.82) rotate(4deg); transform-origin: top right; }
}

.mission-reward-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink);
  line-height: 1.6;
}

.mission-reward-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.35rem 0;
}

.discovery-icon {
  width: 5rem;
  height: 5rem;
  display: grid;
  place-items: center;
  margin: 0 auto 0.2rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(240, 189, 108, 0.35);
  background: rgba(240, 189, 108, 0.13);
  color: var(--sun);
  font-size: 1.9rem;
  font-weight: 900;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
  color: var(--muted);
  font-weight: 800;
}

.info-button {
  width: 2.4rem;
  padding: 0;
  border-radius: 50%;
  color: #fff3bc;
  border-color: rgba(240, 189, 108, 0.42);
}

.info-button:active {
  transform: scale(0.92);
}

.info-dialog {
  width: min(38rem, calc(100vw - 1.4rem));
}

.info-dialog .close-button {
  width: 2.35rem;
  padding: 0;
  font-size: 1.35rem;
}

.guide-intro {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid rgba(240, 189, 108, 0.3);
  border-radius: 0.5rem;
  background: rgba(240, 189, 108, 0.1);
}

.guide-icon {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(103, 180, 200, 0.2);
  font-size: 1.55rem;
}

.guide-intro strong,
.guide-section h3,
.guide-control-list dt {
  color: var(--sun);
}

.guide-intro p,
.guide-section p,
.guide-control-list dd {
  margin: 0.3rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.guide-section {
  margin-top: 0.75rem;
  padding: 0.8rem;
  border-bottom: 1px solid rgba(247, 243, 223, 0.1);
}

.guide-section h3 {
  margin: 0;
  font-size: 1rem;
}

.guide-controls {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(247, 243, 223, 0.05);
}

.guide-pad {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  margin: 2rem auto;
  border: 1px solid rgba(247, 243, 223, 0.16);
  border-radius: 50%;
  background: rgba(247, 243, 223, 0.08);
  backdrop-filter: blur(12px);
}
.guide-pad::before, .guide-pad::after {
  content: "";
  position: absolute;
  inset: 1.05rem;
  border-radius: 50%;
  pointer-events: none;
}
.guide-pad::before { border: 1px solid rgba(247, 243, 223, 0.1); }
.guide-pad::after { inset: 0.42rem; border: 1px dashed rgba(240, 189, 108, 0.12); }
.guide-pad .guide-pad-jump { left: 50%; top: -0.2rem; }
.guide-pad .guide-pad-mode { left: 0.82rem; top: 50%; }
.guide-pad .guide-pad-companion { left: calc(100% - 0.82rem); top: 50%; }
.guide-pad-knob {
  position: absolute; top: 50%; left: 50%; width: 2.4rem; height: 2.4rem;
  transform: translate(-50%, -50%); border-radius: 50%; background: rgba(240, 189, 108, 0.9);
}
.guide-pad .pad-action { pointer-events: none; }

.guide-control-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.guide-control-list div {
  padding-top: 0.65rem;
  border-top: 1px solid rgba(247, 243, 223, 0.08);
}

.guide-control-list dt { font-weight: 900; }
.guide-control-list dd { margin-left: 0; font-size: 0.9rem; }
}

.wide-button {
  width: 100%;
  justify-content: center;
  margin: 0.35rem 0 0.2rem;
}

.option-toggle {
  margin-top: 0;
}

.choice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.slider-row {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
  color: var(--muted);
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--sun);
}

@media (pointer: coarse), (max-width: 760px) {
  button,
  input,
  .encyclopedia-card.is-known {
    touch-action: manipulation;
  }

  .mobile-pad {
    width: 8.5rem;
    height: 8.5rem;
  }

  .hud {
    top: max(0.7rem, env(safe-area-inset-top));
    left: max(0.7rem, env(safe-area-inset-left));
    right: max(0.7rem, env(safe-area-inset-right));
  }

  .icon-button,
  .sound-button:not(.hud-icon-button),
  .fullscreen-button {
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0 0.7rem;
    font-size: 0.8rem;
  }

  .sound-button:not(.hud-icon-button),
  .fullscreen-button {
    width: 2.75rem;
    padding: 0;
  }

  .fullscreen-button {
    display: inline-flex;
  }

  .journal-card {
    grid-template-columns: 1fr;
  }

  .journal-book,
  .travel-map,
  .journey-stamps,
  .stat-grid,
  .customize-layout {
    grid-template-columns: 1fr;
  }

  .custom-preview {
    min-height: 14rem;
  }

  .daily-sketch {
    grid-template-columns: 1fr;
  }

  .message {
    bottom: max(9.8rem, calc(env(safe-area-inset-bottom) + 9rem));
  }

  .panel-dialog {
    width: min(34rem, calc(100vw - 1rem));
    max-height: calc(100dvh - 1rem);
  }

  .panel-dialog form {
    max-height: calc(100dvh - 1rem);
    padding: 0.85rem;
  }
}

body[data-control-input="touch"] .mobile-pad {
  display: block;
}

body[data-control-input="desktop"] .mobile-pad {
  display: none;
}

body[data-mobile-device="false"] .mobile-pad {
  display: none !important;
}

/* Keep the virtual joystick off computers, including touchscreen laptops. */
@media (hover: hover) and (pointer: fine) {
  .mobile-pad {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .start-screen {
    align-items: end;
    padding-bottom: 8rem;
  }

  .start-actions button {
    width: 100%;
  }

  .field-row {
    width: 100%;
  }
}

@media (pointer: coarse) and (orientation: landscape) {
  .game-shell {
    min-height: 100dvh;
  }

  .hud {
    justify-content: flex-end;
  }

  .hud-group {
    max-width: min(31rem, calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 1.4rem));
    justify-content: flex-end;
  }

  .mobile-pad {
    left: max(1.25rem, calc(env(safe-area-inset-left) + 1rem));
    bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + 1rem));
    width: min(8.2rem, 24dvh);
    height: min(8.2rem, 24dvh);
  }

  .message {
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: min(32rem, calc(100vw - 12rem));
  }

  .mission-tracker {
    top: max(4.25rem, calc(env(safe-area-inset-top) + 3.2rem));
    left: max(1rem, env(safe-area-inset-left));
    width: min(18rem, 36vw);
  }

  .panel-dialog {
    width: min(38rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 1rem);
  }
}
