:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #26352b;
  background: #dcebd2;
  font-synthesis: none;
  letter-spacing: 0;
  --ink: #26352b;
  --muted: #627066;
  --paper: #fffdf5;
  --yellow: #f4c44e;
  --yellow-dark: #b87b20;
  --green: #5d9b52;
  --green-dark: #357047;
  --coral: #e76f51;
  --sky: #b9dfe5;
  --brown: #7c4b2d;
  --line: #2f4838;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  background-color: #dcebd2;
  background-image:
    linear-gradient(90deg, rgba(47, 72, 56, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(47, 72, 56, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  display: grid;
  place-items: center;
}

button {
  font: inherit;
  color: inherit;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid #1d6792;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.game-app {
  position: relative;
  width: min(100vw, 430px);
  min-height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  background: var(--paper);
  border-inline: 1px solid rgba(47, 72, 56, 0.25);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  isolation: isolate;
}

.topbar {
  min-height: 68px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 9px;
  background: var(--yellow);
  border-bottom: 3px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.brand-lockup .brand-kicker {
  font-size: 12px;
  font-weight: 800;
  color: #6f4a1a;
}

.brand-lockup strong {
  font-size: 23px;
  line-height: 1;
  font-weight: 950;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.55);
}

.top-actions {
  display: flex;
  gap: 7px;
}

.icon-button,
.close-button {
  width: 36px;
  height: 36px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff9df;
  box-shadow: 2px 2px 0 var(--line);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 21px;
  font-weight: 900;
  cursor: pointer;
}

.icon-button:active,
.close-button:active,
.dock-button:active,
.sheet-action:active,
.plot-panel button:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.hud {
  background: #fffdf5;
  border-bottom: 2px solid var(--line);
  padding: 8px 12px 9px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.meter-block {
  min-width: 0;
}

.meter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 10px;
  color: var(--muted);
}

.meter-label strong {
  color: var(--ink);
  font-size: 10px;
}

.meter-track {
  height: 8px;
  overflow: hidden;
  background: #e9e4d4;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.meter-fill {
  display: block;
  width: 0;
  height: 100%;
  transition: width 280ms ease;
}

.meter-fill.mood {
  background: var(--yellow);
}

.meter-fill.gut {
  background: var(--green);
}

.meter-fill.fullness {
  background: #e58a45;
}

.meter-fill.bond {
  background: var(--coral);
}

.resources {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding-left: 2px;
}

.resources > span {
  min-width: 34px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f3efe2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
}

.resources b {
  font-size: 13px;
  font-style: normal;
}

.resources span:nth-child(2) b {
  color: var(--green-dark);
}

.resources span:nth-child(3) b {
  color: #ee7183;
}

.resources span:nth-child(4) b {
  color: #1d6792;
}

.yard {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--sky);
}

#gameCanvas {
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: block;
  cursor: pointer;
  image-rendering: pixelated;
  touch-action: manipulation;
}

.scene-heading {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 9px;
}

.scene-heading button {
  min-height: 40px;
  padding: 6px 11px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fffdf5;
  box-shadow: 2px 2px 0 var(--line);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.scene-heading div {
  min-width: 108px;
  padding: 5px 9px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #fff5d8;
  display: flex;
  flex-direction: column;
}

.scene-heading span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.scene-heading strong {
  font-size: 13px;
}

.goal-banner {
  position: absolute;
  top: 10px;
  left: 12px;
  width: calc(100% - 104px);
  max-width: 302px;
  min-height: 52px;
  padding: 7px 12px 7px 72px;
  background: #fffdf5;
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(47, 72, 56, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}

.yard.farm-scene .goal-banner {
  top: 64px;
  width: calc(100% - 24px);
  max-width: none;
}

.side-menu {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 8px;
  bottom: 10px;
  width: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  pointer-events: none;
}

.side-menu-button {
  position: relative;
  width: 68px;
  min-height: 52px;
  padding: 4px 3px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 253, 245, 0.96);
  box-shadow: 2px 2px 0 rgba(47, 72, 56, 0.86);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  pointer-events: auto;
}

.side-menu-button:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.side-menu-button strong {
  font-size: 10px;
}

.side-menu-button small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
}

.side-menu-icon {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 950;
}

.yard-icon { background: #a8cf72; }
.dress-icon { background: #f7c6c0; color: #a3473b; }
.partner-icon { background: #d7eef1; color: #1d6792; }
.note-icon { background: #fff1b8; color: #a3473b; }
.growth-icon { background: #cbd6f0; color: #3f5592; }
.profile-icon { background: #d8954f; color: white; }

.partner-entry em {
  position: absolute;
  right: 59px;
  top: 50%;
  width: 104px;
  min-height: 30px;
  transform: translateY(-50%);
  padding: 6px 7px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--line);
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.partner-entry em::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--line);
  border-right: 2px solid var(--line);
  background: var(--yellow);
  transform: rotate(45deg);
}

.partner-entry.has-visitor {
  animation: visitor-bounce 720ms steps(2, end) infinite;
}

@keyframes visitor-bounce {
  50% { transform: translateY(-5px); }
}

.goal-banner::before {
  content: "TODAY";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 61px;
  background: var(--coral);
  color: white;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 900;
}

.goal-banner span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
}

.goal-banner strong {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.35;
}

.goal-banner.tutorial-active {
  background: #fff3c2;
  box-shadow: 3px 3px 0 var(--coral);
}

.goal-banner.tutorial-active::before {
  content: "GUIDE";
  background: var(--green-dark);
}

.speech-bubble {
  position: absolute;
  top: 116px;
  left: 18px;
  max-width: 176px;
  padding: 8px 10px;
  background: white;
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: 2px 2px 0 rgba(47, 72, 56, 0.7);
  font-size: 12px;
  font-weight: 800;
  z-index: 2;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -9px;
  width: 12px;
  height: 12px;
  background: white;
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: rotate(45deg);
}

.digest-panel,
.activity-panel,
.plot-panel {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  min-height: 56px;
  padding: 9px 11px;
  background: #fffdf5;
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(47, 72, 56, 0.7);
  z-index: 3;
}

.digest-copy,
.activity-copy,
.plot-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.digest-track,
.activity-track {
  height: 10px;
  margin-top: 7px;
  overflow: hidden;
  background: #e8e0c8;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.digest-track span,
.activity-track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--coral);
}

.activity-panel {
  background: #fff1b8;
}

.activity-track span {
  background: var(--green-dark);
}

.plot-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plot-panel > div {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.plot-panel button,
.sheet-action {
  min-height: 40px;
  padding: 8px 16px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--line);
  font-weight: 900;
  cursor: pointer;
}

.plot-panel button:disabled,
.sheet-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.action-dock {
  min-height: 82px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: #fffdf5;
  border-top: 3px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dock-button {
  position: relative;
  min-width: 0;
  min-height: 60px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #f3efe2;
  box-shadow: 2px 2px 0 var(--line);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.dock-button.primary {
  background: var(--yellow);
}

.dock-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-style: normal;
  line-height: 1;
}

.dock-pixel-icon {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
}

.dock-icon.ball {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: inset -4px -3px 0 #b4473a;
}

.dock-icon.note {
  border: 2px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--coral);
  font-size: 12px;
  font-weight: 950;
}

.dock-icon.growth {
  border: 2px solid var(--line);
  border-radius: 3px;
  background: #d7eef1;
  color: #1d6792;
  font-size: 12px;
  font-weight: 950;
}

.dock-icon.interaction {
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #f7c6c0;
  color: var(--coral);
  font-size: 14px;
  font-weight: 950;
}

.dock-icon.backpack {
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #d8954f;
  color: white;
  font-size: 10px;
  font-weight: 950;
  box-shadow: inset 0 5px 0 #edb86f;
}

.dock-button em {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding-inline: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  font-size: 10px;
  font-style: normal;
  display: grid;
  place-items: center;
}

.dock-button.cooldown {
  background: #ddd8c9;
  color: #73766f;
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(27, 43, 32, 0.58);
  cursor: pointer;
}

.modal-backdrop.static {
  cursor: default;
}

.bottom-sheet,
.note-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 3px solid var(--line);
  border-radius: 8px 8px 0 0;
}

.catalog-sheet {
  max-height: 88%;
  overflow-y: auto;
}

.bottom-sheet header,
.note-sheet header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.bottom-sheet header span,
.note-sheet header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bottom-sheet h2,
.note-sheet h2,
.celebration-card h2 {
  margin: 3px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.food-row {
  min-height: 74px;
  padding: 10px;
  border-block: 1px solid #b9b6aa;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
}

.crop-options,
.food-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.choice-button,
.food-choice {
  min-width: 0;
  min-height: 92px;
  padding: 8px 5px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #f3efe2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}

.choice-button:disabled,
.food-choice:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.choice-button:not(:disabled):active,
.food-choice:not(:disabled):active,
.stepper button:active {
  transform: translateY(2px);
}

.choice-button.seed-shortage {
  border-color: #c46b4d;
  background: #fff1df;
}

.choice-button.seed-shortage small {
  color: #9b412d;
  font-weight: 900;
}

.food-choice.selected {
  background: #fff1b8;
  box-shadow: inset 0 0 0 2px var(--coral);
}

.choice-icon,
.food-choice > span,
.crop-pixel-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 23px;
  line-height: 1;
}

.crop-pixel-icon,
.inventory-pixel-icon {
  image-rendering: pixelated;
}

.choice-button strong,
.food-choice strong {
  font-size: 13px;
}

.choice-button small,
.food-choice small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  text-align: center;
}

.blueberry-icon {
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #5b69b8;
  color: white;
  font-size: 10px !important;
  font-weight: 900;
}

.sheet-hint {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.quantity-row {
  min-height: 62px;
  margin-top: 12px;
  padding-block: 9px;
  border-block: 1px solid #b9b6aa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quantity-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  font-weight: 900;
}

.quantity-row small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.stepper {
  flex: none;
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-columns: 36px 38px 36px;
  overflow: hidden;
}

.stepper button {
  border: 0;
  background: #fff5d8;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.stepper button:disabled {
  color: #a9a69c;
  cursor: not-allowed;
}

.stepper strong {
  border-inline: 2px solid var(--line);
  background: white;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.feed-forecast {
  min-height: 52px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  background: #d7eef1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.feed-forecast span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.feed-forecast strong {
  color: #a3473b;
  font-size: 12px;
}

.feed-forecast strong.ready {
  color: var(--green-dark);
}

.feed-rule {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.interaction-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.interaction-choice {
  min-width: 0;
  min-height: 114px;
  padding: 9px 7px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff8e7;
  box-shadow: 2px 2px 0 var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  text-align: center;
}

.interaction-choice:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.interaction-choice:disabled {
  cursor: not-allowed;
  box-shadow: none;
}

.interaction-choice.cooldown {
  background: #e7e3d8;
  color: #747971;
}

.interaction-choice.selected {
  background: #fff1b8;
  box-shadow: inset 0 0 0 2px var(--coral), 2px 2px 0 var(--line);
}

.interaction-duration {
  margin-top: 12px;
  padding: 10px;
  border: 2px solid var(--line);
  background: #f3efe2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.interaction-duration > span {
  font-size: 11px;
  font-weight: 900;
}

.interaction-duration > div {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  border: 2px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.interaction-duration button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: white;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.interaction-duration button:last-child { border-right: 0; }
.interaction-duration button.active { background: var(--yellow); }

.interaction-sheet .sheet-action {
  width: 100%;
  margin-top: 11px;
}

.interaction-choice > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.interaction-choice strong {
  font-size: 13px;
}

.interaction-choice small {
  min-height: 26px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.interaction-choice b {
  color: var(--green-dark);
  font-size: 9px;
}

.interaction-choice.cooldown b {
  color: var(--coral);
}

.interaction-icon {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: var(--yellow);
  display: grid;
  place-items: center;
  color: var(--brown);
  font-size: 11px;
  font-weight: 950;
}

.interaction-icon.ball-mini {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: inset -4px -3px 0 #b4473a;
}

.backpack-sheet {
  max-height: 88%;
  overflow-y: auto;
}

.backpack-tool {
  margin-bottom: 12px;
}

.inventory-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 2px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.inventory-tabs button {
  min-width: 0;
  min-height: 38px;
  padding: 5px 3px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #f3efe2;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.inventory-tabs button:last-child {
  border-right: 0;
}

.inventory-tabs button.active {
  background: var(--yellow);
}

.backpack-inventory {
  margin-top: 12px;
}

.inventory-section + .inventory-section {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 2px solid #d7d2c4;
}

.inventory-heading {
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inventory-heading h3 {
  margin: 0;
  font-size: 13px;
}

.inventory-heading > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tool-card {
  min-height: 72px;
  padding: 9px;
  border: 2px solid #aaa99f;
  border-radius: 6px;
  background: #efede5;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: #747971;
}

.tool-card.unlocked {
  border-color: var(--yellow-dark);
  background: #fff1b8;
  color: var(--ink);
}

.inventory-icon.tool {
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #b5b2a8;
  display: grid;
  place-items: center;
  color: white;
  font-size: 17px;
  font-weight: 950;
}

.pixel-item-canvas {
  image-rendering: pixelated;
}

.tool-card:not(.unlocked) .pixel-item-canvas {
  filter: grayscale(1);
  opacity: 0.58;
}

.tool-card.unlocked .pixel-item-canvas {
  filter: none;
  opacity: 1;
}

.tool-card.unlocked .inventory-icon.tool {
  background: var(--yellow);
  color: var(--yellow-dark);
}

.tool-card > div {
  min-width: 0;
}

.tool-card strong {
  font-size: 13px;
}

.tool-card p {
  margin: 3px 0 0;
  font-size: 9px;
  line-height: 1.35;
}

.tool-card > b {
  padding: 6px 8px;
  border: 2px solid #aaa99f;
  border-radius: 5px;
  background: #dedbd2;
  font-size: 9px;
  white-space: nowrap;
}

.tool-card.unlocked > b {
  border-color: var(--line);
  background: var(--yellow);
}

.tool-card button {
  min-height: 34px;
  padding: 6px 9px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: var(--yellow);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.tool-card button:disabled {
  border-color: #aaa99f;
  background: #dedbd2;
  color: #777a74;
  cursor: not-allowed;
}

.inventory-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.inventory-item {
  min-width: 0;
  min-height: 58px;
  padding: 7px 8px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: white;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 48px;
  align-items: center;
  gap: 7px;
}

.inventory-item:nth-child(odd) {
  border-right: 2px solid var(--line);
}

.inventory-item:nth-child(n + 3) {
  border-top: 2px solid var(--line);
}

.inventory-item > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 950;
}

.inventory-pixel-icon {
  width: 34px;
  height: 34px;
}

.inventory-poop-icon {
  width: 34px;
  height: 34px;
  image-rendering: pixelated;
}

.inventory-item > span.blue-dot {
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #5b69b8;
  color: white;
  font-size: 8px;
}

.inventory-item > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.inventory-item strong {
  font-size: 10px;
}

.inventory-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.25;
}

.inventory-item b {
  font-size: 10px;
  white-space: nowrap;
}

.inventory-item button {
  width: 48px;
  min-height: 32px;
  padding: 4px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--line);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.inventory-item button:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.inventory-poops {
  min-height: 54px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.poop-stack {
  min-width: 0;
  min-height: 42px;
  padding: 6px 8px;
  border: 2px solid var(--line);
  background: white;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.poop-stack span {
  width: 17px;
  height: 17px;
  border: 2px solid var(--line);
  border-radius: 3px 3px 6px 6px;
  background: var(--poop-color);
}

.poop-stack strong,
.poop-stack b {
  font-size: 9px;
}

.inventory-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 10px;
  border: 1px dashed #9d9c93;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.carry-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.game-app.carrying .action-dock,
.game-app.carrying .top-actions,
.game-app.poop-action .action-dock,
.game-app.poop-action .top-actions {
  pointer-events: none;
  opacity: 0.55;
}

.carry-status {
  position: absolute;
  left: 50%;
  width: min(300px, calc(100% - 36px));
  min-height: 48px;
  transform: translateX(-50%);
  padding: 6px 7px 6px 11px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fffdf5;
  box-shadow: 3px 3px 0 rgba(47, 72, 56, 0.78);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: auto;
}

.carry-status > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.carry-status span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.carry-status strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carry-status button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #f3efe2;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.carry-token {
  position: absolute;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  padding: 6px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 rgba(47, 72, 56, 0.82);
  display: grid;
  place-items: center;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.carry-token.dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.08);
}

#carryCropIcon {
  width: 42px;
  height: 42px;
}

#carryPoopIcon {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
}

.food-art {
  width: 48px;
  height: 48px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #f7dbd7;
  display: grid;
  place-items: center;
  font-size: 28px;
}

.food-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.food-copy strong {
  font-size: 15px;
}

.food-copy span {
  color: var(--muted);
  font-size: 11px;
}

.food-count {
  font-weight: 900;
}

.sheet-action {
  width: 100%;
  margin-top: 16px;
  min-height: 48px;
  font-size: 15px;
}

.note-card {
  min-height: 270px;
  padding: 18px 16px;
  border: 3px solid var(--line);
  background-color: #fff5d8;
  background-image:
    linear-gradient(90deg, rgba(231, 111, 81, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(231, 111, 81, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.view-tabs {
  height: 42px;
  margin-bottom: 12px;
  border: 2px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
}

.view-tabs button {
  border: 0;
  background: #f3efe2;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.view-tabs button + button {
  border-left: 2px solid var(--line);
}

.view-tabs button.active {
  background: var(--yellow);
}

.note-date {
  align-self: flex-start;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.note-card > strong {
  margin-top: 10px;
  font-size: 20px;
}

.note-card p {
  margin: 7px 0 16px;
  font-size: 13px;
}

.note-card small {
  color: var(--muted);
  font-weight: 800;
}

.gallery-view {
  max-height: 52svh;
  overflow-y: auto;
}

.gallery-progress {
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  background: #d7eef1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.gallery-progress strong {
  font-size: 14px;
}

.poop-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.poop-entry {
  min-height: 76px;
  padding: 7px;
  border: 2px solid #bbb6a8;
  background: #efede5;
  color: #797d77;
  display: grid;
  grid-template-columns: 25px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 7px;
  align-items: center;
}

.poop-entry i {
  grid-row: 1 / 4;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.poop-entry b {
  font-size: 11px;
}

.poop-entry span {
  font-size: 9px;
}

.poop-entry strong {
  font-size: 9px;
}

.poop-entry.unlocked {
  border-color: var(--entry-color);
  background: white;
  color: var(--ink);
}

.poop-entry.unlocked i {
  border-color: var(--line);
  background: var(--entry-color);
  color: white;
}

.poop-entry.unlocked strong {
  color: var(--entry-color);
}

.gallery-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.pixel-poop {
  position: relative;
  width: 56px;
  height: 52px;
}

.pixel-poop i {
  position: absolute;
  display: block;
  background: #ed7187;
  border: 3px solid var(--line);
}

.pixel-poop i:nth-child(1) {
  left: 7px;
  bottom: 0;
  width: 46px;
  height: 22px;
  border-radius: 5px;
}

.pixel-poop i:nth-child(2) {
  left: 14px;
  bottom: 17px;
  width: 34px;
  height: 19px;
  border-radius: 4px;
}

.pixel-poop i:nth-child(3) {
  left: 23px;
  bottom: 31px;
  width: 18px;
  height: 17px;
  border-radius: 3px;
}

.pixel-poop.common i {
  background: #8c684d;
}

.pixel-poop.orange i {
  background: #ed8a45;
}

.pixel-poop.blue i {
  background: #5b69b8;
}

.pixel-poop.green i {
  background: #63a857;
}

.pixel-poop.darkGreen i {
  background: #28714d;
}

.pixel-poop.yellow i,
.pixel-poop.gold i {
  background: #e7b62f;
}

.pixel-poop.brown i {
  background: #8c593d;
}

.pixel-poop.purple i {
  background: #8b57a2;
}

.pixel-poop.rainbow i:nth-child(1) {
  background: #ed7187;
}

.pixel-poop.rainbow i:nth-child(2) {
  background: #e7b62f;
}

.pixel-poop.rainbow i:nth-child(3) {
  background: #5b69b8;
}

.pixel-poop.large {
  margin-top: 12px;
  transform: scale(1.3);
}

.celebration {
  align-items: center;
}

.celebration-card {
  position: relative;
  z-index: 1;
  width: calc(100% - 40px);
  padding: 24px 18px 20px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #fff5d8;
  box-shadow: 6px 6px 0 var(--line);
  text-align: center;
}

.result-kicker {
  color: var(--coral);
  font-size: 11px;
  font-weight: 950;
}

.pixel-poop.hero {
  margin: 18px auto 13px;
  transform: scale(1.65);
}

.celebration-card p {
  margin: 8px 0 16px;
  font-weight: 800;
}

.celebration-card .result-formula {
  margin: -8px 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  font-weight: 700;
}

.tutorial-card {
  max-height: calc(100% - 28px);
  overflow-y: auto;
}

.tutorial-dog {
  position: relative;
  width: 70px;
  height: 62px;
  margin: 12px auto 10px;
  border: 3px solid var(--line);
  border-radius: 7px;
  background: #d8954f;
  box-shadow: 4px 4px 0 #c7a260;
  display: grid;
  place-items: center;
}

.tutorial-dog::before,
.tutorial-dog::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 18px;
  height: 20px;
  border: 3px solid var(--line);
  background: #b96f39;
}

.tutorial-dog::before {
  left: 5px;
  transform: rotate(-12deg);
}

.tutorial-dog::after {
  right: 5px;
  transform: rotate(12deg);
}

.tutorial-dog span {
  position: relative;
  z-index: 1;
  color: #fff8e9;
  font-size: 22px;
  font-weight: 950;
}

.tutorial-dog i {
  position: absolute;
  z-index: 2;
  right: 9px;
  bottom: 8px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--line);
  background: #ed7187;
}

.tutorial-card > p {
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.55;
}

.tutorial-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 14px;
  text-align: left;
}

.tutorial-stats div {
  min-height: 58px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tutorial-stats b {
  font-size: 11px;
}

.tutorial-stats span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.tutorial-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
}

.tutorial-actions .sheet-action {
  margin-top: 0;
}

#tutorialSkipButton[hidden] + #tutorialActionButton {
  grid-column: 1 / -1;
}

.reward-line {
  padding: 10px;
  border-block: 1px solid #c6ab78;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.reward-line span {
  color: var(--muted);
  font-size: 10px;
}

#visitorReward {
  white-space: pre-line;
  line-height: 1.65;
}

.visitor-avatar,
.event-seal {
  width: 68px;
  height: 68px;
  margin: 14px auto 10px;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: #d8954f;
  box-shadow: 5px 5px 0 #c7a260;
  display: grid;
  place-items: center;
  color: white;
  font-size: 26px;
  font-weight: 950;
}

.visitor-card {
  max-height: calc(100% - 28px);
  overflow-y: auto;
}

.visitor-visuals {
  min-height: 90px;
  margin: 14px auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.visitor-visuals .visitor-avatar {
  margin: 0;
  padding: 0;
  background: #fff5d8;
  image-rendering: pixelated;
}

.visitor-item-card {
  width: 84px;
  min-height: 86px;
  padding: 5px 5px 4px;
  border: 3px solid var(--line);
  border-radius: 7px;
  background: white;
  box-shadow: 4px 4px 0 #c7a260;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

#visitorItemArt {
  width: 58px;
  height: 58px;
  image-rendering: pixelated;
}

.visitor-item-card small {
  width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-seal {
  background: #5b69b8;
  box-shadow: 5px 5px 0 #e8aa38;
  image-rendering: pixelated;
}

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

.visitor-actions .sheet-action:only-child {
  grid-column: 1 / -1;
}

.sheet-action.secondary {
  background: #f3efe2;
}

.growth-sheet {
  max-height: 86%;
  overflow-y: auto;
}

.growth-summary {
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 2px solid var(--line);
  background: #d7eef1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}

.growth-summary strong {
  font-size: 13px;
}

.milestone-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.milestone-list li {
  min-height: 58px;
  padding: 8px;
  border: 2px solid #b9b6aa;
  background: #f3efe2;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
}

.milestone-list li.done {
  border-color: var(--green-dark);
  background: #e2f0d9;
}

.milestone-list li.current {
  border-color: var(--coral);
  background: #fff1d3;
}

.milestone-list i {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.milestone-list div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.milestone-list strong {
  font-size: 12px;
}

.milestone-list span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.milestone-list b {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.quality-legend {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.quality-legend span {
  min-height: 44px;
  padding: 6px 3px;
  border: 1px solid var(--line);
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 9px;
  text-align: center;
}

.quality-legend b {
  font-size: 11px;
}

.visitor-roster-heading {
  margin-top: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.visitor-roster {
  margin-top: 7px;
  display: grid;
  gap: 6px;
}

.visitor-clue {
  min-height: 50px;
  padding: 7px;
  border: 2px solid #b9b6aa;
  background: #f3efe2;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.visitor-clue.seen {
  border-color: #4f7f4d;
  background: #e2f0d9;
}

.visitor-clue i {
  width: 27px;
  height: 27px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: white;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.visitor-clue div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.visitor-clue strong {
  font-size: 11px;
}

.visitor-clue span,
.visitor-clue b {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.visitor-clue b {
  white-space: nowrap;
}

.visitor-clue-avatar {
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #fff5d8;
  image-rendering: pixelated;
}

.dress-sheet,
.partner-sheet,
.profile-sheet {
  max-height: 88%;
  overflow-y: auto;
}

.dress-category-tabs {
  margin-bottom: 10px;
  border-bottom: 2px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dress-category-tabs button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.dress-category-tabs button.active {
  background: #fff1b8;
  color: var(--ink);
  box-shadow: inset 0 -4px 0 var(--coral);
}

.dress-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dress-choice {
  min-width: 0;
  min-height: 108px;
  padding: 8px 4px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #f3efe2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.dress-choice.selected {
  background: #fff1b8;
  box-shadow: inset 0 0 0 2px var(--coral);
}

.dress-choice strong {
  font-size: 11px;
}

.dress-choice small {
  color: var(--muted);
  font-size: 8px;
}

.dress-preview {
  position: relative;
  width: 48px;
  height: 48px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #d7eef1;
  overflow: hidden;
}

.dress-preview::before,
.dress-preview::after {
  content: "";
  position: absolute;
}

.dress-preview.none::before {
  left: 9px;
  top: 21px;
  width: 27px;
  height: 4px;
  background: var(--muted);
  transform: rotate(-38deg);
}

.dress-preview.straw::before {
  left: 7px;
  top: 18px;
  width: 32px;
  height: 8px;
  background: #e7b62f;
  border: 2px solid var(--line);
}

.dress-preview.straw::after {
  left: 15px;
  top: 8px;
  width: 16px;
  height: 13px;
  background: #f4c44e;
  border: 2px solid var(--line);
}

.dress-preview.beret::before {
  left: 10px;
  top: 12px;
  width: 28px;
  height: 16px;
  border: 2px solid var(--line);
  border-radius: 50% 50% 4px 4px;
  background: var(--coral);
}

.dress-preview.raincoat::before,
.dress-preview.vest::before {
  left: 10px;
  top: 9px;
  width: 28px;
  height: 32px;
  border: 2px solid var(--line);
  background: #e7b62f;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}

.dress-preview.vest::before { background: var(--coral); }

.dress-preview.green::before,
.dress-preview.redscarf::before,
.dress-preview.bell::before {
  left: 8px;
  top: 20px;
  width: 32px;
  height: 7px;
  border: 2px solid var(--line);
  background: var(--green);
}

.dress-preview.redscarf::before { background: var(--coral); }
.dress-preview.bell::before { background: #5b69b8; }

.dress-preview.bell::after {
  left: 19px;
  top: 27px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--line);
  background: var(--yellow);
}

.dress-preview.boots::before,
.dress-preview.sneakers::before {
  left: 6px;
  bottom: 9px;
  width: 15px;
  height: 11px;
  border: 2px solid var(--line);
  background: #e7b62f;
  box-shadow: 20px 0 0 -2px #e7b62f, 20px 0 0 0 var(--line);
}

.dress-preview.sneakers::before {
  height: 8px;
  background: #5b69b8;
  box-shadow: 20px 0 0 -2px #5b69b8, 20px 0 0 0 var(--line);
}

.dress-preview.classic { background: #79b95f; }
.dress-preview.flowers { background: #a8cf72; }
.dress-preview.picnic { background: #d7eef1; }

.dress-preview.classic::before {
  left: 9px;
  bottom: 7px;
  width: 28px;
  height: 24px;
  border: 2px solid var(--line);
  background: #d8954f;
  clip-path: polygon(50% 0, 100% 35%, 100% 100%, 0 100%, 0 35%);
}

.dress-preview.flowers::before {
  left: 7px;
  top: 8px;
  width: 30px;
  height: 30px;
  border: 4px dotted #e76f51;
  border-radius: 50%;
}

.dress-preview.picnic::before {
  left: 8px;
  bottom: 7px;
  width: 30px;
  height: 24px;
  border: 2px solid var(--line);
  background: repeating-linear-gradient(45deg, #fff8e9 0 7px, #e76f51 7px 14px);
}

.partner-summary {
  min-height: 78px;
  margin-bottom: 12px;
  padding: 9px;
  border: 2px solid var(--line);
  background: #d7eef1;
  display: grid;
  grid-template-columns: 48px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
}

.partner-summary > div:nth-child(2) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.partner-summary span { color: var(--muted); font-size: 10px; font-weight: 800; }
.partner-summary strong { font-size: 15px; }
.partner-summary p { grid-column: 2; margin: 2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.35; }

.pixel-door {
  grid-row: 1 / 3;
  position: relative;
  width: 42px;
  height: 56px;
  border: 3px solid var(--line);
  background: #a76942;
  box-shadow: inset 5px 0 0 #d8954f;
}

.pixel-door i:first-child {
  position: absolute;
  right: 5px;
  top: 27px;
  width: 5px;
  height: 5px;
  background: var(--yellow);
}

.pixel-door i:last-child {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 22px;
  height: 10px;
  border: 2px solid var(--line);
  background: #fff5d8;
}

.profile-id-card {
  position: relative;
  min-height: 120px;
  padding: 12px;
  border: 3px solid var(--line);
  background: #fff1b8;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

#profileAvatar {
  width: 96px;
  height: 96px;
  border: 2px solid var(--line);
  background: #b9dfe5;
  image-rendering: pixelated;
}

.profile-id-card span { color: var(--muted); font-size: 9px; font-weight: 900; }
.profile-id-card h3 { margin: 2px 0; font-size: 26px; }
.profile-id-card p { margin: 0; font-size: 11px; font-weight: 800; }
.profile-id-card > b {
  position: absolute;
  right: 9px;
  top: 9px;
  padding: 3px 6px;
  border: 2px solid var(--line);
  background: white;
  font-size: 9px;
}

.profile-facts {
  margin: 12px 0;
  border-block: 2px solid var(--line);
}

.profile-facts div {
  min-height: 42px;
  padding: 7px 2px;
  border-bottom: 1px solid #cec9b9;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
}

.profile-facts div:last-child { border-bottom: 0; }
.profile-facts dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.profile-facts dd { margin: 0; font-size: 12px; font-weight: 900; }

.profile-records {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.profile-records div {
  min-height: 62px;
  padding: 8px 3px;
  border: 2px solid var(--line);
  background: #f3efe2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.profile-records strong { font-size: 18px; }
.profile-records span { color: var(--muted); font-size: 9px; font-weight: 800; }

.profile-quote {
  margin: 12px 0 0;
  padding: 10px;
  border-left: 5px solid var(--coral);
  background: #fff5d8;
  font-size: 11px;
  font-weight: 800;
}

.shop-icon { background: #f7c6c0; color: #a3473b; }

.compact-sheet {
  max-height: 70%;
  overflow-y: auto;
}

.unlock-requirement {
  min-height: 82px;
  margin-bottom: 14px;
  padding: 11px;
  border: 2px solid var(--line);
  background: #fff1b8;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
}

.unlock-requirement canvas { image-rendering: pixelated; }
.unlock-requirement div { display: flex; flex-direction: column; gap: 3px; }
.unlock-requirement span,
.unlock-requirement small { color: var(--muted); font-size: 10px; font-weight: 800; }
.unlock-requirement strong { font-size: 15px; }

.seed-exchange-sheet,
.shop-sheet {
  max-height: 88%;
  overflow-y: auto;
}

.seed-exchange-list,
.recipe-list {
  display: grid;
  gap: 7px;
}

.seed-exchange-summary {
  margin: 0 0 9px;
  padding: 7px 8px;
  border: 2px solid var(--line);
  background: #fff3c4;
  color: var(--line);
  font-size: 9px;
  font-weight: 850;
  line-height: 1.45;
}

.seed-exchange-guide {
  margin: -2px 0 9px;
  padding: 7px 8px;
  border-left: 3px solid var(--green-dark);
  background: #edf6df;
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 850;
  line-height: 1.45;
}

.seed-exchange-item,
.recipe-item {
  min-height: 76px;
  padding: 8px;
  border: 2px solid var(--line);
  background: #fff8e7;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.seed-exchange-item.locked,
.recipe-item.locked { background: #e8e4d9; }

.seed-exchange-item.targeted {
  outline: 3px solid var(--yellow);
  outline-offset: -3px;
  background: #fff3c4;
}
.seed-exchange-item canvas,
.recipe-item canvas { image-rendering: pixelated; }
.seed-exchange-item > div,
.recipe-item > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.seed-exchange-item strong,
.recipe-item strong { font-size: 12px; }
.seed-exchange-item span,
.seed-exchange-item small,
.recipe-item small,
.recipe-item em { color: var(--muted); font-size: 8px; font-style: normal; line-height: 1.35; }
.seed-exchange-item .seed-source { color: var(--green-dark); font-weight: 850; }
.seed-exchange-item button,
.recipe-item button,
.shop-item button {
  min-height: 34px;
  padding: 5px 8px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: var(--yellow);
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}
.seed-exchange-item button:disabled,
.recipe-item button:disabled,
.shop-item button:disabled { opacity: 0.45; cursor: not-allowed; }

.recipe-item p {
  margin: 2px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.recipe-item p span {
  padding: 2px 4px;
  border: 1px solid #b9b6aa;
  background: white;
  font-size: 8px;
  font-weight: 800;
}
.recipe-item p .ready { color: var(--green-dark); }
.recipe-item p .missing { color: #a3473b; }
.recipe-item .recipe-poop-odds {
  margin-top: 2px;
  padding-top: 3px;
  border-top: 1px dashed #b9b6aa;
  color: var(--green-dark);
  font-weight: 800;
}

.shop-item {
  min-height: 112px;
  padding: 12px;
  border: 2px solid var(--line);
  background: #fff1b8;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.shop-item > div:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.shop-item strong { font-size: 14px; }
.shop-item p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.shop-item small { color: #a3473b; font-size: 9px; font-weight: 900; }
.shop-footnote { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }

.pixel-tonic {
  position: relative;
  width: 42px;
  height: 50px;
  border: 4px solid var(--line);
  background: #e76f51;
  box-shadow: inset 0 9px 0 #fff8e9;
}
.pixel-tonic::before { content: ""; position: absolute; left: 8px; top: -11px; width: 18px; height: 10px; border: 3px solid var(--line); background: #f4c44e; }
.pixel-tonic::after { content: "+"; position: absolute; inset: 13px 0 0; color: white; font-size: 22px; font-weight: 950; text-align: center; }

.level-medal {
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  border: 5px solid var(--line);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 6px 6px 0 var(--coral);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 950;
}

.level-roadmap li.locked { opacity: 0.66; }

.activity-active .yard canvas { cursor: wait; }
.activity-active .dock-button:disabled,
.activity-active .side-menu-button:disabled { opacity: 0.55; cursor: wait; }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  z-index: 30;
  max-width: calc(100% - 36px);
  transform: translateX(-50%);
  padding: 9px 13px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--ink);
  color: white;
  box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.toast.above-yard-panel {
  bottom: calc(164px + env(safe-area-inset-bottom));
}

.pulse {
  animation: pulse 900ms steps(2, end) infinite;
}

@keyframes pulse {
  50% {
    filter: brightness(1.12);
    transform: translateY(-2px);
  }
}

@media (min-width: 700px) and (min-height: 760px) {
  .game-app {
    min-height: 0;
    height: min(920px, 96svh);
    border: 3px solid var(--line);
    border-radius: 8px;
    box-shadow: 12px 14px 0 rgba(47, 72, 56, 0.32);
  }
}

@media (max-height: 740px) {
  .topbar {
    min-height: 58px;
    padding-block: calc(7px + env(safe-area-inset-top)) 6px;
  }

  .brand-lockup strong {
    font-size: 20px;
  }

  .hud {
    padding-block: 6px;
  }

  .action-dock {
    min-height: 70px;
    padding-top: 6px;
  }

  .dock-button {
    min-height: 52px;
  }

  #gameCanvas {
    min-height: 360px;
  }

  .side-menu {
    gap: 4px;
  }

  .side-menu-button {
    min-height: 45px;
  }

  .side-menu-icon {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
