:root {
  --grass-1: #dfe8b9;
  --grass-2: #c6d894;
  --grass-3: #8fab68;
  --leaf: #536b45;
  --leaf-dark: #344638;
  --cream: #fffaf0;
  --paper: #f7efd9;
  --paper-2: #eee2c4;
  --soil: #a87952;
  --terracotta: #b76f52;
  --gold: #d5a255;
  --blue: #819da0;
  --ink: #35443a;
  --muted: #758073;
  --line: rgba(64, 82, 61, 0.14);
  --shadow: 0 16px 34px rgba(62, 78, 50, 0.15);
  --small-shadow: 0 8px 18px rgba(62, 78, 50, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--grass-1);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.22), transparent 240px),
    var(--grass-1);
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(213, 162, 85, 0.42);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
}

svg {
  width: 19px;
  height: 19px;
}

.app {
  width: min(1600px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 18px 92px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 66px;
  padding: 0 4px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark,
.portrait {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(67, 91, 62, 0.16);
  border-radius: 50%;
  background: #f4e7b8;
  color: var(--leaf);
  box-shadow: var(--small-shadow);
  font-family: "STKaiti", "KaiTi", serif;
  font-weight: 700;
}

.brand p,
.brand h1 {
  margin: 0;
}

.brand p {
  color: var(--muted);
  font-size: 11px;
}

.brand h1 {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-chip,
.focus-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.68);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.day-chip {
  gap: 6px;
  color: #75613f;
}

.day-chip svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
  box-shadow: var(--small-shadow);
  cursor: pointer;
}

.icon-button:hover:not(:disabled) {
  background: var(--cream);
}

.icon-button.small {
  width: 34px;
  height: 34px;
  box-shadow: none;
}

.game-layout {
  display: grid;
  grid-template-columns: 266px minmax(560px, 1fr) 250px;
  gap: 14px;
  align-items: stretch;
  min-height: calc(100vh - 178px);
}

.left-panel,
.right-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

.welcome-note,
.goal-card,
.active-card,
.progress-card,
.resources,
.residents {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  box-shadow: var(--small-shadow);
}

.welcome-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.portrait {
  width: 38px;
  height: 38px;
  box-shadow: none;
}

.welcome-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.welcome-note .note-kicker {
  margin-bottom: 2px;
  color: var(--leaf);
  font-weight: 700;
}

.goal-card,
.progress-card,
.resources,
.residents {
  padding: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
  font-size: 13px;
  font-weight: 800;
}

.tiny-label,
.section-title > span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.action-list {
  display: grid;
  gap: 7px;
}

.action-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 64px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.42);
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.action-row:hover:not(:disabled) {
  border-color: rgba(83, 107, 69, 0.18);
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(2px);
}

.action-row:disabled {
  opacity: 0.52;
}

.action-icon,
.resource-item > span,
.active-icon,
.harvest-item > span,
.inventory-row > span,
.building-row > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: #e8d9aa;
  color: #6d613f;
}

.action-copy {
  min-width: 0;
}

.action-copy strong,
.action-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-copy strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.action-copy small {
  color: var(--muted);
  font-size: 10px;
}

.action-arrow {
  width: 16px;
  color: var(--muted);
}

.active-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border-color: rgba(183, 111, 82, 0.22);
  background: #f7e5cf;
  cursor: pointer;
}

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

.active-icon {
  width: 40px;
  height: 40px;
  background: #dce8b8;
  color: var(--leaf);
}

.active-card span,
.active-card strong,
.active-card small {
  display: block;
}

.active-card span,
.active-card small {
  color: var(--muted);
  font-size: 10px;
}

.active-card strong {
  margin: 2px 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-card {
  margin-top: auto;
}

.stage-track,
.focus-progress {
  overflow: hidden;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(83, 107, 69, 0.13);
}

.stage-track span,
.focus-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #82a66c, #d2a15c);
  transition: width 300ms ease;
}

.progress-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.world {
  min-width: 0;
}

.map {
  position: relative;
  min-height: 570px;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(55, 74, 48, 0.17);
  border-radius: 8px;
  background: #b8ca7f;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.map > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
}

.map-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255, 250, 224, 0.06), transparent 34%),
    radial-gradient(circle at center, transparent 60%, rgba(55, 71, 38, 0.1));
}

.hotspot {
  position: absolute;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hotspot:disabled {
  cursor: default;
}

.spot-pulse {
  position: relative;
  width: 34px;
  height: 34px;
  border: 7px solid rgba(255, 250, 221, 0.9);
  border-radius: 50%;
  background: rgba(213, 162, 85, 0.92);
  box-shadow:
    0 0 0 1px rgba(69, 83, 50, 0.25),
    0 4px 12px rgba(61, 76, 48, 0.22);
}

.hotspot:not(:disabled) .spot-pulse::after {
  position: absolute;
  inset: -9px;
  border: 2px solid rgba(255, 250, 221, 0.72);
  border-radius: 50%;
  content: "";
  animation: pulse-ring 2.2s ease-out infinite;
}

.spot-label {
  max-width: 100px;
  padding: 5px 8px;
  border: 1px solid rgba(54, 70, 48, 0.14);
  border-radius: 6px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 4px 10px rgba(57, 71, 45, 0.15);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.hotspot.is-locked {
  opacity: 0.48;
}

.hotspot.is-locked .spot-pulse {
  border-color: rgba(239, 239, 220, 0.84);
  background: #819083;
}

.hotspot.is-complete {
  opacity: 0;
  pointer-events: none;
}

.field-spot {
  left: 18%;
  bottom: 20%;
}

.cabin-spot {
  right: 19%;
  top: 22%;
}

.orchard-spot {
  right: 31%;
  bottom: 35%;
}

.mine-spot {
  left: 11%;
  top: 18%;
}

.road-spot {
  right: 9%;
  bottom: 14%;
}

.map-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(64, 82, 61, 0.12);
  border-radius: 7px;
  background: rgba(255, 250, 240, 0.82);
  color: var(--muted);
  font-size: 11px;
  backdrop-filter: blur(8px);
}

.map-caption svg {
  width: 15px;
  height: 15px;
}

.map-tip {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 8px 11px;
  border-radius: 7px;
  background: rgba(47, 61, 43, 0.82);
  color: #fffbed;
  font-size: 11px;
  transform: translateX(-50%);
  transition: opacity 200ms ease;
  backdrop-filter: blur(6px);
}

.map-tip.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.map-tip svg {
  width: 15px;
  height: 15px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--leaf);
  font-size: 11px;
  cursor: pointer;
}

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

.resource-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.38);
}

.resource-item > span {
  width: 31px;
  height: 31px;
}

.resource-item svg {
  width: 16px;
  height: 16px;
}

.resource-item strong,
.resource-item small {
  display: block;
}

.resource-item strong {
  font-size: 13px;
}

.resource-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.letter-card {
  position: relative;
  min-height: 170px;
  padding: 22px 18px 17px;
  border: 1px solid rgba(116, 89, 52, 0.15);
  border-radius: 4px;
  background:
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(108, 87, 54, 0.055) 26px),
    #f5e9cd;
  box-shadow: var(--small-shadow);
  transform: rotate(0.5deg);
}

.letter-pin {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 38px;
  height: 13px;
  border-radius: 2px;
  background: rgba(204, 168, 111, 0.75);
  transform: translateX(-50%) rotate(-2deg);
}

.letter-card p {
  margin: 0;
}

.letter-card .letter-from {
  margin-bottom: 8px;
  color: #8a704a;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 13px;
  font-weight: 700;
}

#storyCopy {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 14px;
  line-height: 1.75;
}

.letter-card > span {
  position: absolute;
  right: 15px;
  bottom: 12px;
  color: #9a876b;
  font-size: 10px;
}

.residents {
  margin-top: auto;
}

.resident-empty {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.resident-empty svg {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  color: #9a8c6f;
}

.resident-empty p {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.resident-row {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.38);
  text-align: left;
  cursor: pointer;
}

.resident-row:disabled {
  opacity: 0.55;
}

.fox-avatar {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 50% 50% 43% 43%;
  background: #d59063;
  color: #fff8e8;
  font-family: "STKaiti", "KaiTi", serif;
  font-weight: 700;
}

.resident-row strong,
.resident-row small {
  display: block;
}

.resident-row strong {
  font-size: 12px;
}

.resident-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resident-row > svg {
  width: 15px;
}

.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 50%;
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 13px 30px rgba(50, 67, 46, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.nav-button {
  display: inline-flex;
  min-width: 76px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav-button svg {
  width: 17px;
  height: 17px;
}

.nav-button.is-active {
  background: #e7dfbf;
  color: var(--leaf-dark);
  font-weight: 700;
}

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(47, 61, 44, 0.43);
  backdrop-filter: blur(5px);
}

.task-dialog,
.pause-dialog,
.harvest-dialog,
.drawer-dialog,
.settings-dialog {
  width: min(500px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(64, 82, 61, 0.16);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 28px 70px rgba(41, 54, 39, 0.28);
}

.task-dialog form,
.pause-dialog form,
.harvest-dialog form,
.drawer-dialog form,
.settings-dialog form {
  position: relative;
  margin: 0;
  padding: 24px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  box-shadow: none;
}

.dialog-illustration {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 122px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 115%, #a97852 0 30%, transparent 31%),
    linear-gradient(#dce8b5 0 66%, #b9cf8d 67%);
}

.dialog-illustration::before,
.dialog-illustration::after {
  position: absolute;
  bottom: 26px;
  width: 70px;
  height: 36px;
  border-radius: 50%;
  background: #78975e;
  content: "";
  opacity: 0.6;
}

.dialog-illustration::before {
  left: 8%;
}

.dialog-illustration::after {
  right: 8%;
}

.mini-sprout {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 45px;
  border-radius: 8px;
  background: #688b51;
}

.mini-sprout::before,
.mini-sprout::after {
  position: absolute;
  top: 5px;
  width: 30px;
  height: 18px;
  background: #7ea660;
  content: "";
}

.mini-sprout::before {
  right: 6px;
  border-radius: 50% 0 50% 0;
  transform: rotate(18deg);
}

.mini-sprout::after {
  left: 6px;
  border-radius: 0 50% 0 50%;
  transform: rotate(-18deg);
}

.dialog-kicker {
  margin: 0 0 5px;
  color: #8c714d;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

dialog h2 {
  margin: 0 0 8px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 24px;
  letter-spacing: 0;
}

.dialog-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.task-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0;
}

.task-facts > div {
  display: grid;
  grid-template-columns: 25px 1fr;
  padding: 11px;
  border-radius: 7px;
  background: var(--paper);
}

.task-facts svg {
  grid-row: 1 / 3;
  width: 18px;
  color: #8b704b;
}

.task-facts span,
.task-facts strong {
  display: block;
}

.task-facts span {
  color: var(--muted);
  font-size: 9px;
}

.task-facts strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reality-label {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 700;
}

#realityInput {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(64, 82, 61, 0.17);
  border-radius: 7px;
  background: white;
}

#realityInput::placeholder {
  color: #a0a79d;
}

.cost-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.cost-line.is-missing {
  color: #ad5d4c;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.primary-button,
.ghost-button,
.reset-save-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid rgba(64, 82, 61, 0.13);
  border-radius: 7px;
  cursor: pointer;
}

.primary-button {
  background: var(--leaf);
  color: #fffdf2;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--leaf-dark);
}

.ghost-button {
  background: var(--paper);
}

.primary-button.wide {
  width: 100%;
  margin-top: 18px;
}

.focus-dialog {
  width: min(850px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 28px 70px rgba(41, 54, 39, 0.3);
}

.focus-scene {
  position: relative;
  display: grid;
  place-items: end center;
  min-height: 320px;
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(255, 247, 211, 0.56), transparent 62%),
    #c9dc9e;
}

.focus-scene::before {
  position: absolute;
  right: -5%;
  bottom: -58px;
  left: -5%;
  height: 170px;
  border-radius: 50% 50% 0 0;
  background: #9fbd78;
  content: "";
}

.focus-scene::after {
  position: absolute;
  right: 7%;
  bottom: 63px;
  left: 7%;
  height: 23px;
  border-radius: 50%;
  background: rgba(69, 91, 52, 0.12);
  content: "";
}

.sky-glow {
  position: absolute;
  top: 32px;
  left: 15%;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 239, 173, 0.48);
  filter: blur(2px);
}

.focus-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 4;
  box-shadow: none;
}

.focus-land {
  position: relative;
  z-index: 2;
  width: 220px;
  height: 220px;
  margin-bottom: 35px;
}

.focus-soil {
  position: absolute;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 60px;
  border-radius: 50%;
  background: #99704e;
  box-shadow: inset 0 7px rgba(255, 255, 255, 0.08);
}

.focus-plant {
  position: absolute;
  bottom: 38px;
  left: 50%;
  width: 15px;
  height: 100px;
  border-radius: 10px;
  background: #62834f;
  transform: translateX(-50%);
  transform-origin: bottom;
  animation: plant-sway 3s ease-in-out infinite;
}

.focus-plant::before,
.focus-plant::after,
.focus-plant i,
.focus-plant b {
  position: absolute;
  width: 66px;
  height: 39px;
  background: #7da461;
  content: "";
}

.focus-plant::before {
  top: 12px;
  right: 7px;
  border-radius: 50% 0 50% 0;
  transform: rotate(13deg);
}

.focus-plant::after {
  top: 34px;
  left: 7px;
  border-radius: 0 50% 0 50%;
  transform: rotate(-12deg);
}

.focus-plant i {
  top: -20px;
  left: -25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #86a968;
}

.focus-plant b {
  top: 58px;
  right: 6px;
  width: 45px;
  height: 28px;
  border-radius: 50% 0 50% 0;
  background: #769c5a;
}

.focus-land[data-visual="mine"] .focus-plant,
.focus-land[data-visual="caravan"] .focus-plant,
.focus-land[data-visual="cabin"] .focus-plant,
.focus-land[data-visual="bakery"] .focus-plant {
  width: 130px;
  height: 100px;
  border-radius: 50% 50% 8px 8px;
  background: #7c8580;
  animation: gentle-breathe 2.5s ease-in-out infinite;
}

.focus-land[data-visual="mine"] .focus-plant::before {
  top: 35px;
  right: 30px;
  width: 70px;
  height: 55px;
  border-radius: 50% 50% 0 0;
  background: #3d4643;
  transform: none;
}

.focus-land[data-visual="cabin"] .focus-plant,
.focus-land[data-visual="bakery"] .focus-plant {
  border-radius: 6px;
  background: #d2a16b;
}

.focus-land[data-visual="cabin"] .focus-plant::before,
.focus-land[data-visual="bakery"] .focus-plant::before {
  top: -30px;
  right: -12px;
  width: 154px;
  height: 52px;
  border-radius: 6px;
  background: var(--terracotta);
  transform: none;
}

.focus-land[data-visual="caravan"] .focus-plant {
  width: 150px;
  height: 76px;
  border-radius: 30px 24px 8px 8px;
  background: #c58f53;
  animation: caravan-roll 2s ease-in-out infinite;
}

.focus-land[data-visual="mine"] .focus-plant::after,
.focus-land[data-visual="mine"] .focus-plant i,
.focus-land[data-visual="mine"] .focus-plant b,
.focus-land[data-visual="cabin"] .focus-plant::after,
.focus-land[data-visual="cabin"] .focus-plant i,
.focus-land[data-visual="cabin"] .focus-plant b,
.focus-land[data-visual="bakery"] .focus-plant::after,
.focus-land[data-visual="bakery"] .focus-plant i,
.focus-land[data-visual="bakery"] .focus-plant b,
.focus-land[data-visual="caravan"] .focus-plant::before,
.focus-land[data-visual="caravan"] .focus-plant::after,
.focus-land[data-visual="caravan"] .focus-plant i,
.focus-land[data-visual="caravan"] .focus-plant b {
  display: none;
}

.focus-content {
  padding: 25px 30px 24px;
  text-align: center;
}

.focus-content h2 {
  margin-bottom: 5px;
}

.reality-task {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.timer {
  margin: 15px 0 8px;
  color: var(--leaf-dark);
  font-family: "Segoe UI", sans-serif;
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  letter-spacing: 0;
}

.focus-progress {
  height: 9px;
}

#focusGuide {
  margin: 11px 0 0;
  color: var(--muted);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 14px;
}

.focus-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.focus-footer > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.focus-footer svg {
  width: 14px;
  height: 14px;
}

.text-button.danger {
  color: #a56355;
}

.pause-dialog {
  width: min(420px, calc(100vw - 24px));
  text-align: center;
}

.pause-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 15px;
  border-radius: 50%;
  background: #e5edc8;
  color: var(--leaf);
}

.pause-mark svg {
  width: 26px;
  height: 26px;
}

.pause-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.pause-dialog .dialog-actions {
  justify-content: center;
}

.harvest-dialog form {
  overflow: hidden;
}

.harvest-rays {
  position: absolute;
  top: -95px;
  right: -70px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(213, 162, 85, 0.09) 0 12deg, transparent 12deg 24deg);
  animation: slow-spin 24s linear infinite;
}

.harvest-list {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.harvest-item,
.inventory-row,
.building-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 7px;
  background: var(--paper);
}

.harvest-item {
  grid-template-columns: 42px minmax(0, 1fr);
}

.harvest-item strong,
.harvest-item small,
.inventory-row strong,
.inventory-row small,
.building-row strong,
.building-row small {
  display: block;
}

.harvest-item strong,
.inventory-row strong,
.building-row strong {
  font-size: 12px;
}

.harvest-item small,
.inventory-row small,
.building-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.unlock-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(213, 162, 85, 0.24);
  border-radius: 7px;
  background: #f7e8bf;
  color: #725c37;
}

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

.unlock-note svg {
  flex: 0 0 auto;
  color: var(--gold);
}

.unlock-note span,
.unlock-note strong {
  display: block;
}

.unlock-note span {
  font-size: 11px;
  line-height: 1.55;
}

.unlock-note strong {
  margin-bottom: 2px;
}

.drawer-dialog {
  width: min(620px, calc(100vw - 24px));
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.drawer-head .icon-button {
  box-shadow: none;
}

.full-inventory,
.building-list {
  display: grid;
  gap: 8px;
}

.inventory-row.is-empty,
.building-row.is-locked {
  opacity: 0.48;
}

.inventory-row b {
  font-size: 13px;
}

.empty-drawer,
.friend-letter {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  padding: 24px;
  border-radius: 7px;
  background: var(--paper);
  text-align: center;
}

.empty-drawer svg {
  width: 40px;
  height: 40px;
  color: #a89978;
}

.empty-drawer p {
  max-width: 330px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.fox-avatar.large {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

.friend-letter p {
  margin: 14px 0 8px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 17px;
}

.friend-letter small {
  margin-top: 5px;
  color: var(--muted);
}

.settings-dialog {
  width: min(480px, calc(100vw - 24px));
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px;
  border-radius: 7px;
  background: var(--paper);
  cursor: pointer;
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row strong {
  font-size: 13px;
}

.setting-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.setting-row input {
  width: 42px;
  height: 22px;
  accent-color: var(--leaf);
}

.reset-save-button {
  width: 100%;
  margin-top: 12px;
  background: transparent;
  color: #a35c50;
}

.toast {
  position: fixed;
  bottom: 78px;
  left: 50%;
  z-index: 100;
  max-width: min(420px, calc(100vw - 30px));
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(47, 61, 44, 0.92);
  color: #fffbed;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

@keyframes pulse-ring {
  from {
    opacity: 0.8;
    transform: scale(0.72);
  }

  to {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes plant-sway {
  0%,
  100% {
    transform: translateX(-50%) rotate(-1.5deg);
  }

  50% {
    transform: translateX(-50%) rotate(1.5deg);
  }
}

@keyframes gentle-breathe {
  0%,
  100% {
    transform: translateX(-50%) scale(0.98);
  }

  50% {
    transform: translateX(-50%) scale(1.02);
  }
}

@keyframes caravan-roll {
  0%,
  100% {
    transform: translateX(-54%);
  }

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

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .game-layout {
    grid-template-columns: 248px minmax(530px, 1fr);
  }

  .right-panel {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .residents {
    margin-top: 0;
  }

  .letter-card {
    min-height: 150px;
  }
}

@media (max-width: 850px) {
  .app {
    padding: 10px 10px 90px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar-center {
    display: none;
  }

  .game-layout {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .left-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    order: 2;
  }

  .welcome-note,
  .active-card {
    grid-column: 1 / -1;
  }

  .progress-card {
    margin-top: 0;
  }

  .world {
    order: 1;
  }

  .map {
    min-height: 510px;
    aspect-ratio: 4 / 3;
  }

  .right-panel {
    order: 3;
    grid-template-columns: 1fr 1fr;
  }

  .letter-card {
    grid-column: 1 / -1;
    order: -1;
  }
}

@media (max-width: 600px) {
  .brand p {
    display: none;
  }

  .brand h1 {
    font-size: 21px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .game-layout {
    gap: 10px;
  }

  .map {
    min-height: 420px;
    aspect-ratio: auto;
  }

  .map > img {
    width: 760px;
    max-width: none;
    left: 48%;
    transform: translateX(-50%);
  }

  .field-spot {
    left: 12%;
  }

  .cabin-spot {
    right: 12%;
  }

  .orchard-spot {
    right: 25%;
  }

  .mine-spot {
    left: 7%;
  }

  .road-spot {
    right: 5%;
  }

  .spot-label {
    font-size: 9px;
  }

  .map-caption {
    display: none;
  }

  .map-tip {
    bottom: 10px;
    width: max-content;
    max-width: calc(100% - 20px);
  }

  .left-panel,
  .right-panel {
    display: flex;
  }

  .welcome-note {
    order: -2;
  }

  .goal-card {
    order: -1;
  }

  .right-panel .resources,
  .right-panel .residents {
    display: none;
  }

  .letter-card {
    min-height: 140px;
  }

  .bottom-nav {
    right: 8px;
    bottom: 8px;
    left: 8px;
    justify-content: stretch;
    transform: none;
  }

  .nav-button {
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: 5px;
    font-size: 9px;
  }

  .nav-button svg {
    width: 16px;
    height: 16px;
  }

  .task-dialog form,
  .pause-dialog form,
  .harvest-dialog form,
  .drawer-dialog form,
  .settings-dialog form {
    padding: 18px;
  }

  .task-facts {
    grid-template-columns: 1fr;
  }

  .focus-scene {
    min-height: 260px;
  }

  .focus-land {
    transform: scale(0.82);
    transform-origin: bottom;
  }

  .focus-content {
    padding: 21px 18px 18px;
  }

  .timer {
    font-size: 36px;
  }

  .focus-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

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

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