@import url("https://fonts.googleapis.com/css2?family=Mochiy+Pop+One&family=Zen+Maru+Gothic:wght@400;500;700&display=swap");

:root {
  color-scheme: light;
  --ink: #2a2520;
  --muted: #786f64;
  --paper: #fff8e9;
  --paper-deep: #f5e4bf;
  --line: #3c3124;
  --line-soft: #dacaa8;
  --teal: #2f8c87;
  --orange: #f2a12d;
  --green: #88bb64;
  --shadow: 0 16px 34px rgba(82, 64, 38, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family:
    "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo",
    system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.9), transparent 26%),
    linear-gradient(180deg, #fffaf0, #f1dfba);
}

button {
  color: inherit;
  font: inherit;
}

button,
button *,
[role="button"],
[role="button"] *,
.book-progress-link,
.book-progress-link *,
.book-link,
.book-link *,
.back-link,
.back-link *,
.photo-download-link,
.photo-story-link,
.record-dialog-actions a,
.record-dialog-actions a *,
.support-success-actions a,
.support-success-actions a * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.yard,
.yard *,
.photo-preview,
.photo-preview img,
.item-icon,
.pending-photo img,
.recent-photo img,
.book-card img,
.album img,
.story-head img,
.special-photo-entry img,
.unlock-item-stage img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.app {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.app-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.app-header > div:first-child {
  min-width: 0;
  max-width: 100%;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.journal-page .app-header {
  justify-content: flex-start;
}

.journal-page .top-actions {
  margin-left: auto;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border: 3px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
}

.icon-button svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.pwa-install-button {
  color: white;
  background: var(--orange);
}

.pwa-install-button[hidden] {
  display: none;
}

.pwa-home-toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  width: min(620px, calc(100vw - 24px));
  padding: 14px;
  border: 4px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: #fffdf7;
  box-shadow: 0 16px 34px rgba(82, 64, 38, 0.22);
  transform: translateX(-50%);
}

.pwa-home-toast[hidden],
.pwa-home-toast-install[hidden] {
  display: none;
}

.pwa-home-toast-text {
  min-width: 0;
}

.pwa-home-toast-text p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.pwa-home-toast-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.pwa-home-toast-install,
.pwa-home-toast-close {
  min-height: 44px;
  border: 3px solid var(--line);
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 2px 3px 0 rgba(60, 49, 36, 0.14);
  cursor: pointer;
}

.pwa-home-toast-install {
  padding: 0 14px;
  color: white;
  background: var(--orange);
  white-space: nowrap;
}

.pwa-home-toast-close {
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
}

.pwa-home-toast-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.eyebrow {
  margin: 0 0 3px;
  color: #c98620;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.38em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family:
    "Mochiy Pop One", "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo",
    system-ui, sans-serif;
  font-size: clamp(2.35rem, 4vw, 3.25rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}

.title-with-supporter {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.title-with-supporter h1 {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.supporter-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 3px solid var(--line);
  border-radius: 50%;
  color: #9b6b18;
  background: #fff2c2;
  box-shadow: 4px 5px 0 rgba(60, 49, 36, 0.13);
  cursor: pointer;
}

.supporter-mark[hidden] {
  display: none;
}

.supporter-mark svg {
  width: 24px;
  height: 24px;
  fill: #f5c45f;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.supporter-mark:hover {
  transform: translateY(-1px);
}

h2 {
  margin-bottom: 10px;
  font-size: 1.02rem;
}

.status-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.status-pills > span {
  box-sizing: border-box;
  position: relative;
  flex: 0 0 var(--status-pill-width, 96px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: var(--status-pill-width, 96px);
  min-height: 50px;
  padding: 0 14px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

.status-pill-action {
  cursor: pointer;
  user-select: none;
}

.status-pill-action:hover,
.status-pill-action:focus-visible {
  transform: translateY(-1px);
  box-shadow: 4px 5px 0 rgba(60, 49, 36, 0.15);
}

.status-pill-action:focus-visible {
  outline: 3px solid rgba(168, 118, 67, 0.35);
  outline-offset: 3px;
}

#timeLabel {
  --status-pill-width: 96px;
}

#moodLabel {
  --status-pill-width: 118px;
}

.status-pill-track {
  position: absolute;
  inset: 0;
  display: flex;
  width: 200%;
  color: var(--ink);
  animation: status-pill-roll var(--status-roll-duration, 28000ms) ease-in-out forwards;
  will-change: transform;
}

.status-pill-value {
  display: inline-flex;
  flex: 0 0 50%;
  align-items: center;
  justify-content: center;
}

.status-pill-fade-value {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: status-pill-fade-swap var(--status-fade-duration, 2400ms) ease-in-out forwards;
}

@keyframes status-pill-roll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes status-pill-fade-swap {
  0%,
  100% {
    opacity: 1;
  }

  45%,
  55% {
    opacity: 0.22;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-pill-track,
  .status-pill-fade-value {
    animation: none;
  }
}

.book-progress-link,
.book-progress-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 14px;
  border: 3px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  font-weight: 700;
  text-decoration: none;
}

.book-progress-link:hover,
.book-progress-link:focus-visible {
  transform: translateY(-1px);
}

.book-progress-link svg,
.book-progress-pill svg {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.book-progress-link span,
.book-progress-pill span {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.book-progress-link {
  color: white;
  background: var(--teal);
  box-shadow: 3px 4px 0 rgba(47, 140, 135, 0.18);
}

.book-progress-link.has-unread::after,
.book-progress-pill.has-unread::after,
.book-link.has-unread::after,
.book-card.has-unread::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  aspect-ratio: 1;
  border: 2px solid #fffdf7;
  border-radius: 50%;
  background: #d9382f;
  box-shadow: 0 0 0 2px rgba(60, 49, 36, 0.16);
}

.header-story-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 14px;
  border: 3px solid var(--line);
  border-radius: 14px;
  color: white;
  background: var(--teal);
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.language-picker {
  display: inline-grid;
  grid-template-columns: auto minmax(128px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 10px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
}

.language-picker span {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.language-picker select {
  min-width: 0;
  max-width: 100%;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 700;
}

.native-select-hidden {
  display: none !important;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select-button {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 34px 8px 10px;
  border: 3px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fffdf7;
  box-shadow: none;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.custom-select-button::after {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 8px;
  height: 8px;
  border-right: 3px solid var(--muted);
  border-bottom: 3px solid var(--muted);
  content: "";
  transform: translateY(-65%) rotate(45deg);
}

.custom-select-button:disabled {
  opacity: 0.56;
  cursor: default;
}

.custom-select-value {
  display: block;
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-list {
  position: absolute;
  z-index: 35;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: min(260px, 46dvh);
  overflow: auto;
  padding: 6px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 5px 7px 0 rgba(60, 49, 36, 0.14);
}

.custom-select-list[hidden] {
  display: none;
}

.custom-select-option {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.custom-select-option[aria-selected="true"] {
  color: white;
  background: var(--teal);
}

.custom-select-option:disabled {
  opacity: 0.48;
  cursor: default;
}

.language-picker .custom-select-button {
  min-height: 34px;
  padding: 4px 26px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 700;
}

.language-picker .custom-select-list {
  min-width: min(220px, calc(100vw - 48px));
}

.support-language-picker {
  margin: 0 0 14px;
}

.settings-language-picker {
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.game-layout > * {
  min-width: 0;
}

.play-card,
.side-card {
  max-width: 100%;
  border: 4px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.play-card {
  overflow: hidden;
}

.yard {
  --yard-bg: url("./assets/fields/original-noon.webp");
  --yard-next-bg: var(--yard-bg);
  --yard-background-easing: ease-in-out;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-height: 620px;
  aspect-ratio: 16 / 10;
  background: var(--yard-bg) center / cover no-repeat;
  touch-action: none;
  user-select: none;
}

.yard::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: var(--yard-next-bg) center / cover no-repeat;
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 28000ms var(--yard-background-easing);
}

.yard.yard-background-fading::after {
  opacity: 1;
}

.yard.yard-background-resetting::after {
  transition: none;
}

.sky,
.house,
.tree,
.fence,
.grass,
.rug,
.items,
.cat-stage {
  position: absolute;
  z-index: 1;
}

.sky {
  display: none;
}

.sky::before,
.sky::after {
  position: absolute;
  border: 4px solid rgba(60, 49, 36, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  content: "";
}

.sky::before {
  top: 11%;
  left: 12%;
  width: 104px;
  height: 42px;
}

.sky::after {
  top: 17%;
  right: 20%;
  width: 84px;
  height: 34px;
}

.house {
  display: none;
}

.roof {
  position: absolute;
  top: 0;
  left: -5%;
  z-index: 2;
  width: 110%;
  height: 34%;
  clip-path: polygon(8% 100%, 50% 0, 92% 100%);
  background: #8a5a40;
  filter: drop-shadow(4px 5px 0 rgba(60, 49, 36, 0.25));
}

.wall {
  position: absolute;
  bottom: 0;
  left: 8%;
  width: 84%;
  height: 74%;
  border: 5px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: #ffe0a8;
}

.window,
.door {
  position: absolute;
  bottom: 16%;
  border: 5px solid var(--line);
  background: #fff4ce;
}

.window {
  left: 12%;
  width: 30%;
  height: 40%;
}

.door {
  right: 14%;
  width: 24%;
  height: 62%;
  background: #a7704d;
}

.tree {
  display: none;
}

.tree::after {
  position: absolute;
  right: 44%;
  bottom: -96px;
  width: 36px;
  height: 120px;
  border: 5px solid var(--line);
  border-radius: 12px;
  background: #9a633d;
  content: "";
}

.fence {
  display: none;
}

.grass {
  display: none;
}

.rug {
  display: none;
}

.items {
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.placed-item {
  position: absolute;
  width: var(--item-width);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  transform: translate(-50%, -50%);
  transition: scale 120ms ease;
  user-select: none;
}

.placed-item.dragging {
  cursor: grabbing;
  scale: 1.04;
  z-index: 2;
}

.placed-item img {
  display: block;
  width: 100%;
  pointer-events: none;
  filter: drop-shadow(5px 7px 0 rgba(60, 49, 36, 0.12));
}

.cat-stage {
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.cat-sprite {
  position: absolute;
  width: var(--cat-width, var(--cat-default-width, clamp(150px, 20vw, 250px)));
  border: 0;
  background: transparent;
  cursor: grab;
  pointer-events: auto;
  filter: drop-shadow(8px 10px 0 rgba(60, 49, 36, 0.13));
  transform-origin: center bottom;
  transform: translate(-50%, -50%);
  opacity: 1;
  scale: 1;
  touch-action: none;
  animation: catBob 3.2s ease-in-out infinite;
  transition:
    opacity var(--cat-leave-duration, 420ms) ease,
    scale var(--cat-leave-duration, 420ms) ease,
    translate var(--cat-leave-duration, 420ms) ease;
  user-select: none;
}

.cat-sprite img {
  display: block;
  width: 100%;
  pointer-events: none;
  animation: catAppear var(--cat-enter-duration, 520ms) ease-out both;
}

.cat-sprite::after {
  position: absolute;
  right: 13%;
  bottom: 4%;
  left: 13%;
  height: 10px;
  border-radius: 50%;
  background: rgba(60, 49, 36, 0.18);
  content: "";
  filter: blur(2px);
  transform: translateY(10px);
}

.cat-sprite:hover,
.cat-sprite:focus-visible {
  outline: none;
  animation-name: catHoverQuiet;
  animation-duration: 2.8s;
}

.cat-sprite.dragging {
  cursor: grabbing;
  animation-duration: 1.1s;
}

.cat-sprite.is-leaving {
  opacity: 0;
  pointer-events: none;
  scale: 0.96;
  translate: 0 10px;
  animation: none;
}

.cat-sprite.is-leaving img {
  animation: none;
}

.cat-sprite[data-motion="roll"] {
  animation-name: catRoll;
}

.cat-sprite[data-motion="yarn"] {
  animation-name: catYarn;
}

.cat-sprite[data-motion="box"] {
  animation-name: catPeek;
}

.cat-sprite[data-motion="sleep"] {
  animation-name: catSleep;
}

@keyframes catBob {
  0%,
  100% {
    translate: 0 0;
    rotate: -1deg;
  }
  50% {
    translate: 0 -9px;
    rotate: 1deg;
  }
}

@keyframes catRoll {
  0%,
  100% {
    translate: 0 0;
    rotate: -5deg;
  }
  50% {
    translate: 0 -8px;
    rotate: 5deg;
  }
}

@keyframes catYarn {
  0%,
  100% {
    translate: 0 0;
    scale: 1;
  }
  45% {
    translate: 0 -7px;
    scale: 1.025 0.985;
  }
}

@keyframes catPeek {
  0%,
  100% {
    translate: 0 2px;
    rotate: 0deg;
  }
  50% {
    translate: 0 -12px;
    rotate: -1deg;
  }
}

@keyframes catSleep {
  0%,
  100% {
    scale: 1 1;
    translate: 0 0;
  }
  50% {
    scale: 1.03 0.98;
    translate: 0 4px;
  }
}

@keyframes catAppear {
  from {
    opacity: 0;
    scale: 0.96;
    translate: 0 10px;
  }

  to {
    opacity: 1;
    scale: 1;
    translate: 0 0;
  }
}

@keyframes catHoverQuiet {
  0%,
  100% {
    translate: 0 0;
    rotate: -0.4deg;
    scale: 1;
  }
  50% {
    translate: 0 -3px;
    rotate: 0.4deg;
    scale: 1.006;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cat-sprite,
  .cat-sprite img {
    animation: none;
    transition: none;
  }
}

.camera-button {
  position: absolute;
  right: 28px;
  bottom: 18px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  min-height: 52px;
  padding: 0;
  border: 4px solid var(--line);
  border-radius: 16px;
  color: white;
  background: var(--teal);
  box-shadow: 4px 5px 0 rgba(60, 49, 36, 0.22);
  font-weight: 700;
  cursor: pointer;
}

.camera-button:hover {
  transform: translateY(-2px);
}

.camera-icon {
  position: relative;
  width: 30px;
  height: 22px;
  border: 3px solid currentColor;
  border-radius: 6px;
  box-sizing: border-box;
}

.camera-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -9px;
  width: 12px;
  height: 7px;
  border: 3px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: var(--teal);
  box-sizing: border-box;
}

.camera-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 3px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}

.message {
  min-height: 60px;
  margin: 0;
  padding: 16px 18px;
  border-top: 4px solid var(--line);
  background: #fffdf7;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.side-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.side-section + .side-section {
  padding-top: 14px;
  border-top: 3px dashed var(--line-soft);
}

.side-section h2 {
  margin-bottom: 8px;
}

.side-section h3 {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.setting-disclosure {
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
}

.setting-disclosure + .setting-disclosure,
.setting-disclosure + .settings-button {
  margin-top: 8px;
}

.setting-disclosure summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.setting-disclosure summary::-webkit-details-marker {
  display: none;
}

.setting-disclosure summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line-soft);
  border-radius: 999px;
  color: var(--teal);
  line-height: 20px;
  text-align: center;
}

.setting-disclosure[open] summary {
  border-bottom: 3px dashed var(--line-soft);
}

.setting-disclosure[open] summary::after {
  content: "-";
}

.setting-disclosure summary strong {
  min-width: 0;
  color: var(--teal);
  font-size: 0.78rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.setting-disclosure .item-grid,
.setting-disclosure .field-grid {
  padding: 10px;
}

.item-grid,
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.field-grid {
  grid-template-columns: 1fr;
}

.item-button,
.field-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  text-align: left;
  cursor: pointer;
}

.item-button[aria-pressed="true"],
.field-button[aria-pressed="true"] {
  background: #dff4ee;
}

.item-button:disabled,
.field-button:disabled {
  color: #9a8f7d;
  background: #f2e7cf;
  cursor: not-allowed;
}

.layer-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.layer-disclosure .layer-buttons {
  padding: 10px;
}

.layer-buttons button {
  min-height: 46px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  font-weight: 700;
  cursor: pointer;
}

.layer-buttons button:not(:disabled):hover {
  transform: translateY(-1px);
}

.layer-buttons button:disabled {
  color: #b6a995;
  cursor: not-allowed;
  opacity: 0.72;
}

.settings-button {
  width: 100%;
  min-height: 46px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  font-weight: 700;
  cursor: pointer;
}

.settings-button:hover {
  transform: translateY(-1px);
}

.item-icon {
  display: block;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(2px 3px 0 rgba(60, 49, 36, 0.12));
}

.item-icon.locked {
  opacity: 0.46;
  filter: brightness(0) drop-shadow(2px 3px 0 rgba(60, 49, 36, 0.1));
}

.field-swatch {
  display: block;
  flex: 0 0 56px;
  width: 56px;
  height: 42px;
  border: 2px solid var(--line-soft);
  border-radius: 10px;
  background-position: center;
  background-size: cover;
}

.field-button:disabled .field-swatch {
  filter: grayscale(0.8);
  opacity: 0.56;
}

.item-text,
.field-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.item-name,
.field-name {
  display: block;
  margin-top: 0;
  font-size: 0.83rem;
  font-weight: 700;
}

.item-lock,
.field-lock {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
}

.book-link,
.story-shortcut,
.back-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 12px;
  border: 3px solid var(--line);
  border-radius: 14px;
  color: inherit;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.book-link,
.story-shortcut {
  width: 100%;
}

.book-link strong,
.story-shortcut strong {
  color: var(--teal);
}

.story-shortcut {
  margin-top: 8px;
  background: #dff4ee;
}

.story-shortcut[hidden],
.photo-story-link[hidden] {
  display: none;
}

.resource-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.resource-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border: 2px solid var(--line-soft);
  border-radius: 999px;
  background: #fff8e9;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.record-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.record-tools button,
.recent-photo {
  min-height: 44px;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  font-weight: 900;
  cursor: pointer;
}

.record-tools button {
  padding: 0 8px;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.25;
}

.record-tools button[hidden] {
  display: none;
}

.record-tools button:hover,
.recent-photo:hover {
  transform: translateY(-1px);
}

.share-result {
  padding: 12px;
  border: 3px dashed var(--line-soft);
  border-radius: 12px;
  background: #fff8e9;
}

.share-result[hidden] {
  display: none;
}

.share-result h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.share-result p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.7;
}

.share-post-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 3px solid rgba(42, 141, 135, 0.28);
  border-radius: 12px;
  background: #f3fbf8;
}

.yard-actions-section .share-post-preview {
  margin-top: 10px;
}

.share-post-preview[hidden] {
  display: none;
}

.share-post-preview h3 {
  margin: 0;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
}

.share-post-preview p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.65;
}

.share-post-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.share-post-actions a,
.share-post-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 10px;
  border: 3px solid var(--line);
  border-radius: 12px;
  color: white;
  background: var(--teal);
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.14);
  text-align: center;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}

.share-post-actions a:first-child,
.share-post-actions button:first-child {
  background: var(--orange);
}

.share-post-actions a:hover,
.share-post-actions button:hover {
  transform: translateY(-1px);
}

.pending-photos,
.recent-photos,
.observation-log {
  display: grid;
  gap: 8px;
  max-height: 178px;
  overflow: auto;
}

.recent-photos {
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 6px;
}

.pending-photo {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 7px;
  border: 2px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.62);
  color: var(--muted);
  box-shadow: none;
  text-align: left;
  cursor: default;
}

.pending-photo img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.pending-photo span,
.pending-photo strong,
.pending-photo em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pending-photo em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.pending-photo strong {
  color: var(--ink);
  font-weight: 800;
}

.visit-record {
  grid-template-columns: 54px minmax(0, 1fr);
  margin: 0;
}

.visit-record span {
  color: var(--muted);
  font-size: 0.72rem;
}

.recent-photo {
  display: grid;
  gap: 3px;
  padding: 4px;
  color: var(--ink);
  text-align: left;
}

.recent-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--line-soft);
  border-radius: 7px;
  object-fit: cover;
  background: #fff8e9;
}

.recent-photo-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.observation-entry {
  margin: 0;
  padding: 9px 10px;
  border: 3px solid var(--line-soft);
  border-radius: 12px;
  background: #fffdf7;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.55;
}

.observation-entry span {
  display: block;
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 900;
}

.journal-main {
  min-width: 0;
  padding: 18px;
  border: 4px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.journal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 12px;
  margin-bottom: 16px;
}

.back-link {
  display: inline-flex;
  min-height: 48px;
}

.journal-actions .back-link,
.journal-actions .book-progress-pill {
  flex: 1 1 0;
  min-width: 118px;
  min-height: 56px;
  justify-content: center;
  padding: 0 14px;
}

.journal-actions .status-pills {
  flex: 1 1 0;
  min-width: 0;
  margin-top: 0;
}

.journal-actions .book-progress-pill {
  width: 100%;
  white-space: nowrap;
}

.cat-book {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cat-book-page {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.book-card {
  position: relative;
  min-height: 132px;
  padding: 8px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  color: inherit;
  font: inherit;
  text-align: center;
}

button.book-card {
  cursor: pointer;
}

button.book-card:hover,
button.book-card:focus-visible {
  outline: none;
  transform: translateY(-2px);
}

.book-card.unknown {
  color: #a99c86;
  background: repeating-linear-gradient(45deg, #fff8e9 0 10px, #f2e1bf 10px 20px);
}

.book-card.story-complete {
  border-color: #c9932e;
  box-shadow: inset 0 0 0 2px #fff1bf;
}

.book-complete-mark {
  position: absolute;
  inset-block-start: 7px;
  inset-inline-start: 7px;
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #ffe7a8;
  box-shadow: 2px 3px 0 rgba(60, 49, 36, 0.16);
}

.book-complete-mark svg {
  width: 20px;
  height: 20px;
  fill: #fff7d4;
  stroke: #7d5c14;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.book-card img,
.album img {
  display: block;
  width: 74px;
  height: 74px;
  margin: 0 auto 6px;
  object-fit: contain;
}

.book-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.book-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.album {
  display: grid;
  gap: 8px;
  max-height: 164px;
  overflow: auto;
}

.journal-album-section {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px;
  border: 3px solid var(--line-soft);
  border-radius: 16px;
  background: #fff8e9;
}

.journal-album-section h2 {
  margin: 0;
}

.journal-album {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  max-height: none;
}

.journal-recent-photos {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  max-height: none;
}

.album-entry {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
}

.album-entry img {
  width: 46px;
  height: 46px;
  margin: 0;
}

.album-entry strong,
.album-entry span {
  display: block;
  overflow-wrap: anywhere;
}

.album-entry span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.5;
}

.story-panel {
  margin-top: 18px;
  padding: 16px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
}

.journal-page .journal-main > .story-panel {
  display: none;
}

.story-head {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.story-head img {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(5px 7px 0 rgba(60, 49, 36, 0.12));
}

.story-head h2 {
  margin-bottom: 6px;
  font-size: 1.5rem;
}

.story-meta {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

.story-list {
  display: grid;
  gap: 10px;
}

.cat-records,
.journal-section {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.cat-records > h3,
.journal-section > h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.cat-record-grid {
  display: grid;
  gap: 10px;
}

@media (min-width: 760px) {
  .cat-record-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.margin-notes,
.special-photo-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 3px dashed var(--line-soft);
  border-radius: 12px;
  background: #fff8e9;
}

.margin-notes.locked,
.special-photo-list.locked {
  color: #9a8f7d;
  background: repeating-linear-gradient(45deg, #fff8e9 0 10px, #f2e1bf 10px 20px);
}

.margin-notes h4,
.special-photo-list h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
}

.record-count {
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 900;
}

.margin-notes ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.65;
}

.margin-notes li.record-locked-note {
  list-style: none;
  margin-left: -1.15rem;
}

.record-locked-note span {
  display: inline-block;
  width: fit-content;
  padding: 2px 8px;
  border: 2px solid var(--line-soft);
  border-radius: 999px;
  background: #fffdf7;
  color: #8d6a37;
  font-size: 0.76rem;
  font-weight: 900;
}

.record-locked-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.65;
}

.special-photo-entry {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 3px solid var(--line-soft);
  border-radius: 12px;
  background: #fffdf7;
}

.special-photo-entry img {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.special-photo-entry h3 {
  margin: 0;
  font-size: 0.92rem;
}

.special-photo-entry p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.6;
}

.story-entry {
  padding: 12px;
  border: 3px solid var(--line-soft);
  border-radius: 12px;
  background: #fff8e9;
}

.story-entry.locked {
  color: #9a8f7d;
  background: repeating-linear-gradient(45deg, #fff8e9 0 10px, #f2e1bf 10px 20px);
}

.story-entry h3 {
  margin: 0;
  font-size: 0.96rem;
}

.story-entry p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.75;
}

.story-completion-photo {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
}

.story-completion-photo h3 {
  margin: 0;
  font-size: 1rem;
}

.story-completion-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 3px solid var(--line-soft);
  border-radius: 12px;
  background: #fff8e9;
}

.story-completion-photo p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.65;
}

.story-completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.story-completion-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #ffe7a8;
  box-shadow: 2px 3px 0 rgba(60, 49, 36, 0.14);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.story-completion-actions a:hover {
  transform: translateY(-1px);
}

.support-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.support-actions button,
.support-success-actions button {
  min-height: 40px;
  padding: 9px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #ffe7a8;
  box-shadow: 2px 3px 0 rgba(60, 49, 36, 0.14);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.support-actions button:hover,
.support-success-actions button:hover {
  transform: translateY(-1px);
}

.support-actions button:disabled,
.support-success-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.support-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
  margin: 14px 0 18px;
  padding: 16px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
}

.support-card[hidden] {
  display: none;
}

.support-card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: #fffaf0;
  box-shadow: 2px 2px 0 rgba(60, 49, 36, 0.12);
  cursor: pointer;
}

.support-card-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.4;
}

.support-card-close:hover {
  transform: translateY(-1px);
}

.support-card > div:first-of-type {
  padding-right: 34px;
}

.support-card h2 {
  margin-bottom: 6px;
  font-size: 1.15rem;
}

.support-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.support-card .support-backer-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 5px 10px;
  border: 2px solid rgba(110, 79, 32, 0.28);
  border-radius: 999px;
  color: #6b4b20;
  background: #fff5d7;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.support-card .support-backer-badge[hidden] {
  display: none;
}

.support-actions {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.support-actions .support-checkout-secondary {
  justify-self: start;
  padding: 9px 12px;
  border-color: var(--line-soft);
  color: var(--ink);
  background: #fffaf0;
  box-shadow: 2px 2px 0 rgba(60, 49, 36, 0.1);
}

.support-code-details {
  border: 2px dashed var(--line-soft);
  border-radius: 12px;
  background: #fffaf0;
}

.support-code-details summary {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.support-code-form {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 0 12px 12px;
}

.support-code-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.support-code-form input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid var(--line-soft);
  border-radius: 10px;
  color: var(--ink);
  background: #fffaf0;
  font: inherit;
  font-weight: 700;
}

.support-status {
  min-height: 2.8em;
  overflow-wrap: anywhere;
}

.support-success-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.support-success-card {
  width: min(620px, calc(100vw - 48px));
  min-width: 0;
  padding: 22px;
  border: 3px solid var(--line);
  border-radius: 16px;
  background: #fffdf7;
  box-shadow: var(--shadow);
}

.support-success-card h1 {
  margin-bottom: 10px;
  font-size: 1.75rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.support-success-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.supporter-dialog {
  width: min(420px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(42, 37, 32, 0.35);
}

.supporter-dialog::backdrop {
  background: rgba(42, 37, 32, 0.42);
}

.supporter-dialog-sheet {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 4px solid var(--line);
  border-radius: 18px;
  background: #fffdf7;
}

.supporter-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: #fffaf0;
  cursor: pointer;
}

.supporter-dialog-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.4;
}

.supporter-dialog h2 {
  margin: 0;
  padding-right: 40px;
  font-size: 1.28rem;
}

.supporter-dialog p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.supporter-dialog-count {
  width: fit-content;
  padding: 5px 10px;
  border: 2px solid rgba(110, 79, 32, 0.28);
  border-radius: 999px;
  color: #6b4b20;
  background: #fff5d7;
  font-size: 0.82rem;
  font-weight: 900;
}

.supporter-dialog-checkout {
  min-height: 46px;
  padding: 0 14px;
  border: 3px solid var(--line-soft);
  border-radius: 14px;
  color: var(--ink);
  background: #fffaf0;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.1);
  font-weight: 800;
  cursor: pointer;
}

.supporter-dialog-checkout:hover {
  transform: translateY(-1px);
}

.support-code-output {
  display: block;
  width: 100%;
  margin: 16px 0;
  padding: 14px;
  border: 3px dashed var(--line-soft);
  border-radius: 12px;
  color: var(--ink);
  background: #fff8e9;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

.photo-dialog {
  width: min(760px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(42, 37, 32, 0.35);
}

.photo-dialog::backdrop {
  background: rgba(42, 37, 32, 0.45);
}

.photo-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.photo-preview {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 360px;
  place-items: center;
  border-right: 4px solid var(--line);
  background: url("./assets/fields/original-noon.webp") center / cover no-repeat;
}

.photo-preview::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 58%, rgba(255, 255, 255, 0.56), transparent 42%);
  content: "";
  pointer-events: none;
}

.photo-preview img {
  position: relative;
  z-index: 1;
  width: min(310px, 84%);
  filter: drop-shadow(8px 10px 0 rgba(60, 49, 36, 0.16));
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-preview.yard-snapshot-preview {
  padding: 14px;
  background: #f3dfb9;
}

.photo-preview.yard-snapshot-preview::before {
  display: none;
}

.photo-preview.yard-snapshot-preview img {
  width: 100%;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: #fff8e9;
  box-shadow: 5px 6px 0 rgba(60, 49, 36, 0.16);
  filter: none;
}

.photo-dialog:focus,
.photo-preview img:focus {
  outline: none;
}

.photo-text {
  padding: 28px;
}

.photo-text h2 {
  font-size: 1.55rem;
}

.photo-text p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.7;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.photo-x-actions {
  display: contents;
}

.photo-x-actions[hidden] {
  display: none;
}

.photo-text button,
.photo-download-link,
.photo-x-actions a,
.photo-story-link {
  min-height: 48px;
  padding: 0 18px;
  border: 4px solid var(--line);
  border-radius: 14px;
  color: white;
  background: var(--orange);
  box-shadow: 4px 5px 0 rgba(60, 49, 36, 0.2);
  font-weight: 700;
  cursor: pointer;
}

.photo-download-link,
.photo-x-actions a,
.photo-story-link {
  display: inline-flex;
  align-items: center;
  color: white;
  background: var(--teal);
  text-decoration: none;
}

.photo-download-link[aria-disabled="true"] {
  opacity: 0.48;
  pointer-events: none;
}

.unlock-dialog,
.welcome-dialog {
  width: min(450px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(42, 37, 32, 0.35);
}

.unlock-dialog::backdrop,
.welcome-dialog::backdrop {
  background: rgba(42, 37, 32, 0.45);
}

.unlock-sheet,
.welcome-sheet {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 4px solid var(--line);
  border-radius: 18px;
  text-align: center;
}

.welcome-count {
  display: grid;
  width: 92px;
  aspect-ratio: 1;
  margin: 0 auto;
  place-items: center;
  border: 4px solid var(--line);
  border-radius: 50%;
  color: white;
  background: var(--orange);
  box-shadow: 5px 6px 0 rgba(60, 49, 36, 0.14);
  font-size: 2rem;
  font-weight: 800;
}

.content-unlock-lead {
  padding: 10px 12px;
  border: 3px dashed var(--line-soft);
  border-radius: 12px;
  background: #fff8e9;
  color: var(--ink);
}

.unlock-item-stage {
  position: relative;
  display: grid;
  width: min(230px, 72vw);
  aspect-ratio: 1;
  margin: 0 auto;
  place-items: center;
  border: 3px dashed var(--line-soft);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 248, 233, 0.3)),
    #fffdf7;
  box-shadow: 5px 6px 0 rgba(60, 49, 36, 0.12);
}

.unlock-item-stage img {
  position: relative;
  z-index: 1;
  width: min(170px, 70%);
  max-height: 72%;
  object-fit: contain;
  filter: drop-shadow(7px 9px 0 rgba(60, 49, 36, 0.16));
}

.unlock-badge {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 2;
  padding: 4px 10px;
  border: 3px solid var(--line);
  border-radius: 999px;
  color: white;
  background: var(--orange);
  box-shadow: 2px 3px 0 rgba(60, 49, 36, 0.14);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  transform: translateX(-50%) rotate(-2deg);
}

.unlock-text h2,
.welcome-text h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.unlock-text p:not(.eyebrow),
.welcome-text p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.65;
}

.unlock-actions,
.welcome-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.unlock-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 12px;
  border: 3px solid var(--line);
  border-radius: 12px;
  color: white;
  background: var(--teal);
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.14);
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.unlock-actions button,
.welcome-actions button {
  min-height: 48px;
  padding: 0 14px;
  border: 3px solid var(--line);
  border-radius: 14px;
  color: white;
  background: var(--teal);
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.16);
  font-weight: 700;
  cursor: pointer;
}

.unlock-actions button:first-child,
.welcome-actions button:first-child {
  background: var(--orange);
}

.unlock-actions button:hover,
.welcome-actions button:hover {
  transform: translateY(-1px);
}

.record-dialog {
  width: min(440px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(42, 37, 32, 0.35);
}

.record-dialog::backdrop {
  background: rgba(42, 37, 32, 0.42);
}

.record-dialog-sheet {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 4px solid var(--line);
  border-radius: 18px;
}

.record-dialog-head h2 {
  margin-bottom: 0;
  font-size: 1.28rem;
}

.dialog-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.dialog-field input,
.dialog-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 3px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fffdf7;
  font: inherit;
  font-weight: 900;
}

.dialog-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.65;
}

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

.friend-own-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 3px dashed var(--line-soft);
  border-radius: 14px;
  background: #fff8e9;
}

.friend-own-code span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.friend-own-code strong {
  min-width: 0;
  color: var(--teal);
  font-size: 1.12rem;
  overflow-wrap: anywhere;
}

.friend-own-code button {
  min-height: 34px;
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fffdf7;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.friend-own-code button:hover {
  transform: translateY(-1px);
}

.record-dialog-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.record-dialog-actions a,
.record-dialog-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border: 3px solid var(--line);
  border-radius: 14px;
  color: white;
  background: var(--teal);
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.16);
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.record-dialog-actions a:first-child,
.record-dialog-actions button:first-child {
  background: var(--orange);
}

.record-dialog-actions button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.record-dialog-actions a:hover,
.record-dialog-actions button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.settings-dialog {
  width: min(440px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(42, 37, 32, 0.35);
}

.settings-dialog::backdrop {
  background: rgba(42, 37, 32, 0.42);
}

.settings-sheet {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 4px solid var(--line);
  border-radius: 18px;
}

.settings-head h2 {
  margin-bottom: 0;
  font-size: 1.4rem;
}

.size-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  padding: 14px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
}

.size-control span,
.size-control output {
  font-weight: 700;
}

.size-control output {
  color: var(--teal);
}

.size-control input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--teal);
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-actions button {
  min-height: 46px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 3px 4px 0 rgba(60, 49, 36, 0.12);
  font-weight: 700;
  cursor: pointer;
}

.settings-actions button[type="submit"] {
  color: white;
  background: var(--teal);
}

.settings-actions button:hover {
  transform: translateY(-1px);
}

.settings-actions-single {
  grid-template-columns: 1fr;
}

.story-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(42, 37, 32, 0.35);
}

.story-dialog::backdrop {
  background: rgba(42, 37, 32, 0.45);
}

.story-dialog-sheet {
  display: grid;
  max-height: calc(100dvh - 24px);
  border: 4px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.story-panel-dialog {
  max-height: calc(100dvh - 92px);
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
}

.story-dialog-close {
  min-height: 52px;
  border: 0;
  border-top: 4px solid var(--line);
  color: white;
  background: var(--teal);
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 980px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

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

  .side-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-card section:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .app {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 12px;
    overflow-x: hidden;
  }

  .game-layout,
  .play-card,
  .side-card,
  .journal-main {
    width: 100%;
  }

  .app.journal-page {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .app-header {
    position: relative;
    align-items: start;
    width: 100%;
    max-width: 100%;
    padding-right: 54px;
  }

  .app:not(.journal-page) .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .app:not(.journal-page) .app-header > div:first-child {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .app-header:has(.pwa-install-button:not([hidden])) {
    padding-right: 112px;
  }

  .journal-page .app-header {
    align-items: end;
  }

  .top-actions {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    justify-content: flex-end;
    margin-left: 0;
  }

  .app:not(.journal-page) .top-actions {
    position: fixed;
    z-index: 10;
    top: 12px;
    right: 12px;
  }

  .journal-page .top-actions {
    top: 28px;
    justify-content: flex-end;
    margin-left: 0;
  }

  .pwa-home-toast {
    gap: 10px;
    width: calc(100vw - 20px);
    padding: 12px;
    border-radius: 16px;
  }

  .pwa-home-toast-install {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
  }

  .pwa-home-toast-close {
    flex: 0 0 44px;
  }

  .icon-button {
    width: 46px;
    height: 46px;
  }

  .book-progress-link,
  .book-progress-pill {
    height: 46px;
    padding: 0 12px;
  }

  .status-pills {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: nowrap;
    justify-content: flex-start;
    justify-self: start;
    margin-left: 0;
    margin-top: 12px;
  }

  #timeLabel {
    --status-pill-width: 86px;
  }

  #moodLabel {
    --status-pill-width: 104px;
  }

  .status-pills > span {
    flex-basis: var(--status-pill-width, 96px);
    inline-size: var(--status-pill-width, 96px);
    min-height: 46px;
    padding: 0 12px;
  }

  .status-pills .book-progress-link {
    justify-self: start;
    flex: 0 0 auto;
    min-inline-size: 136px;
    min-height: 42px;
    padding: 7px 12px;
    white-space: nowrap;
  }

  .status-pills > .book-progress-link {
    justify-self: start;
    min-width: 136px;
  }

  .status-pills .book-progress-link span {
    white-space: nowrap;
  }

  .language-picker {
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .custom-select-list {
    max-height: min(220px, 42dvh);
  }

  .support-success-page {
    justify-items: start;
  }

  .support-success-card {
    width: min(320px, 100%);
    padding: 18px;
  }

  .support-success-card h1 {
    font-size: 1.55rem;
  }

  .journal-main {
    box-sizing: border-box;
    padding: 12px;
  }

  .journal-actions {
    gap: 8px;
    margin-bottom: 14px;
  }

  .journal-actions .back-link,
  .journal-actions .book-progress-pill {
    min-width: 0;
    min-height: 46px;
    height: 46px;
    padding: 0 10px;
  }

  .journal-actions .status-pills {
    margin-top: 0;
  }

  .journal-actions .book-progress-pill {
    flex: 0 0 auto;
    gap: 8px;
    min-width: 136px;
  }

  .journal-actions .book-progress-pill span {
    white-space: nowrap;
  }

  .journal-actions .book-progress-pill svg {
    width: 24px;
    height: 24px;
  }

  .journal-page .support-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .journal-page .support-code-details[open],
  .journal-page .support-status {
    grid-column: 1 / -1;
  }

  .yard {
    min-height: auto;
    aspect-ratio: 6 / 5;
  }

  .house {
    left: -13%;
    width: 66%;
  }

  .tree {
    right: -78px;
    width: 150px;
    height: 150px;
  }

  .cat-sprite {
    width: var(--cat-width, var(--cat-default-width, 135px));
  }

  .placed-item {
    width: var(--item-width-mobile, var(--item-width));
  }

  .camera-button {
    right: auto;
    left: 12px;
    bottom: 12px;
  }

  .side-card,
  .photo-sheet {
    grid-template-columns: 1fr;
  }

  .setting-disclosure summary {
    grid-template-columns: minmax(0, 1fr) 24px;
    row-gap: 2px;
  }

  .setting-disclosure summary strong {
    grid-column: 1;
    text-align: left;
  }

  .setting-disclosure summary::after {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .item-grid,
  .cat-book {
    grid-template-columns: 1fr;
  }

  .record-tools,
  .special-photo-entry {
    grid-template-columns: 1fr;
  }

  .cat-book-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .cat-book-page .book-card {
    min-height: 112px;
    padding: 7px 5px;
  }

  .cat-book-page .book-card img {
    width: 56px;
    height: 56px;
    margin-bottom: 4px;
  }

  .cat-book-page .book-name {
    font-size: 0.76rem;
    line-height: 1.25;
  }

  .cat-book-page .book-meta {
    margin-top: 2px;
    font-size: 0.64rem;
    line-height: 1.2;
  }

  .story-head {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .story-head img {
    width: 78px;
    height: 78px;
  }

  .photo-preview {
    min-height: 0;
    height: clamp(210px, 54vw, 270px);
    border-right: 0;
    border-bottom: 4px solid var(--line);
  }

  .photo-preview.yard-snapshot-preview {
    height: auto;
  }

  .photo-dialog {
    width: min(340px, calc(100vw - 40px));
    max-height: calc(100dvh - 96px);
    overflow: auto;
  }

  .unlock-dialog {
    width: min(340px, calc(100vw - 40px));
    max-height: calc(100dvh - 96px);
    overflow: auto;
  }

  .unlock-sheet {
    padding: 18px;
  }

  .unlock-actions {
    grid-template-columns: 1fr;
  }

  .photo-preview img {
    width: min(210px, 68%);
  }

  .photo-preview.yard-snapshot-preview img {
    width: 100%;
    height: auto;
    max-height: none;
  }

  .photo-text {
    padding: 20px;
  }

  .photo-text h2 {
    font-size: 1.2rem;
    line-height: 1.35;
  }

  .photo-text p:not(.eyebrow) {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .photo-text button {
    min-height: 44px;
    padding: 0 14px;
    border-width: 3px;
  }
}
