/* Generated from style.css, integration.css, refinement.css, game-ui.css, loading.css. */
/* 百川农场界面：木质横梁、暖羊皮纸与立体农场控件。
 * 场景保留手绘原画，界面保留清晰图册与经营信息顺序；
 * 正文使用清晰字体承担信息，标题字体只用于品牌与面板名称。
 * 结构：1 令牌 / 2 基础 / 3 控件 / 4 顶栏 / 5 场景 / 6 底栏 / 7 菜单 /
 *      8 弹窗 / 9 组件 / 10 面板通用 / 11 响应式 / 12 动效 */
@font-face { font-family: "FarmTitle"; src: url("assets/fonts/font_art.ttf") format("truetype"); font-display: swap; }
:root {
  /* Existing scale names stay stable for the shared components and artwork. */
  --sand1: #fffdf7;
  --sand2: #faf3e3;
  --sand3: #f5ebd6;
  --sand4: #efdfbe;
  --sand5: #e8d3a9;
  --sand6: #dec69a;
  --sand7: #cfa66d;
  --sand8: #b28a55;
  --sand9: #98764f;
  --sand10: #876342;
  --sand11: #6f5235;
  --sand12: #3f2c1c;
  
  
  --sandA3: #20100010;
  
  
  --sandA6: #19130029;
  
  --sandA8: #1915014a;
  
  
  --sandA11: #080800a1;
  
  
  --tomato2: #f6e2cc;
  --tomato3: #f3d9c4;
  --tomato4: #ffdcd3;
  --tomato5: #ffcdc2;
  --tomato6: #fdbdaf;
  --tomato7: #f5a898;
  --tomato8: #ec8e7b;
  --tomato9: #e54d2e;
  
  --tomato11: #d13415;
  --tomato12: #5c271f;
  
  
  
  
  
  
  
  
  
  
  
  
  
  --grass2: #f0f8de;
  --grass3: #e4f3c9;
  --grass4: #daf1db;
  
  --grass6: #b2ddb5;
  --grass7: #94ce9a;
  --grass8: #8bd457;
  --grass9: #48a824;
  --grass10: #5a882a;
  --grass11: #3e6325;
  --grass12: #2f4b1c;
  
  
  
  
  
  
  
  
  
  
  
  
  --sky1: #eeeedc;
  --sky2: #e1e9d9;
  --sky3: #d6e5dc;
  --sky4: #d1f0fa;
  --sky5: #bee7f5;
  --sky6: #a9daed;
  --sky7: #8dcae3;
  --sky8: #60b3d7;
  --sky9: #7ce2fe;
  --sky10: #74daf8;
  --sky11: #00749e;
  --sky12: #1d3e56;
  
  
  
  
  
  --skyA6: #0092ca56;
  
  
  
  
  
  
  --amber1: #f8eed8;
  --amber2: #fff4d2;
  --amber3: #ffecb3;
  --amber4: #ffee9c;
  --amber5: #fbe577;
  --amber6: #f3d673;
  --amber7: #e9c162;
  --amber8: #e2a336;
  --amber9: #ffc53d;
  
  --amber11: #ab6400;
  --amber12: #4f3422;
  
  
  
  
  
  
  
  
  
  
  
  
  --ink: var(--sand12); --ink-soft: var(--sand11); --ink-faint: var(--sand11);
  --paper: var(--sand1); --paper-2: var(--sand2);  --paper-line: var(--sand6);
  --wood: #bd833e; --wood-dark: #75451f; --wood-light: #e3b76d;
  --leaf: var(--grass11); --leaf-2: var(--grass9);  --leaf-dark: var(--grass12);
  --gold: var(--amber9); --gold-dark: var(--amber11); 
    
  --danger: #a53623; --danger-soft: var(--tomato3); --info: var(--sky11);
  --text-sm: 12px; --text-base: 14px; --text-title: 18px; --text-display: 24px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
  
  --lift: 0 3px 0 #75451f28, 0 8px 18px #5f3e2524;
  --grain: radial-gradient(#be92560a .6px, transparent .9px);
  --wood-grain: repeating-linear-gradient(96deg, #fff4cb18 0 1px, transparent 1px 35px, #9b5b2110 35px 37px, transparent 37px 64px);
  --wood-fill: linear-gradient(#e8b866, #d59a4c 18%, #bf7f39);
  --button-fill: linear-gradient(#8bdd53, #68c938 12%, #48a824 88%, #3f951e);
  --button-shadow: inset 0 2px 0 #d2f5a3, 0 3px 0 #2e7a12, 0 5px 7px #356e2024;
  --gold-fill: linear-gradient(#ffe79a, #ffc84d 14%, #f5ac2e 88%, #e69a1d);
  --gold-shadow: inset 0 2px 0 #fff1be, 0 3px 0 #bc791e, 0 5px 7px #945a1a24;
  --control-fill: linear-gradient(#fffdf7, #f5e8c9);
  --control-shadow: inset 0 1px 0 #fffdf7, 0 2px 0 #c7a168;
  --card-shadow: inset 0 1px 0 #fffdf7, 0 2px 0 #b9904e18;
  --game-white: #ffffff;
  --hud-height: 112px; --tools-height: 96px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; color: var(--ink);
  background: var(--grass8);
  font: var(--text-base)/1.55 "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; border: 0; background: none; }
button:disabled { cursor: not-allowed; }
button[aria-busy="true"] { cursor: progress; filter: saturate(.55) brightness(.98); }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible,
#viewport:focus-visible, a:focus-visible { outline: 3px solid var(--sky11); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; font-weight: 800; }
p { margin: 6px 0 10px; }
h1, .farm-brand { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; letter-spacing: 0; }
.ui-icon { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 1.25em; height: 1.25em; }
.ui-icon svg { width: 100%; height: 100%; display: block; }
.ui-item-art { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.ui-item-art svg { width: 100%; height: 100%; display: block; filter: none; }

/* ---------- 3 控件 ---------- */
.action-button, .plain-button, .ghost-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border-radius: var(--r-sm);
   line-height: 1.2; text-align: center; white-space: nowrap;
  transition: none;
}

.action-button:active:not(:disabled) { transform: none; box-shadow: none; }
.action-button:disabled { color: var(--sand4); border-color: var(--sand11); background: var(--sand8); box-shadow: none; text-shadow: none; opacity: .85; }
.action-button[aria-busy="true"] { background: var(--grass7); }

.plain-button:active:not(:disabled) { transform: none; box-shadow: none; }
.plain-button:disabled { color: var(--sand10); border-color: var(--sand8); background: var(--sand4); box-shadow: none; }

.ghost-button:hover:not(:disabled) { border-color: var(--leaf-2); color: var(--leaf); }

input, select, textarea {
   padding: 7px 10px; color: var(--ink);
   
   
  max-width: 100%;
}
input:hover, select:hover { border-color: var(--amber11); }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 22px; accent-color: var(--leaf); box-shadow: none; }
input[type="range"] { min-height: 24px; padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--leaf); }
.quantity, .stepper-input { width: 74px; text-align: center; font-variant-numeric: tabular-nums; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; 
    
     line-height: 1.6; white-space: nowrap;
}
.chip .ui-icon { width: 1.05em; height: 1.05em; }
.chip--leaf { border-color: var(--grass8);   }
.chip--gold { border-color: var(--amber8);   }
.chip--gem { border-color: var(--sky7); background: var(--sky3); color: var(--sky11); }
.chip--danger { border-color: var(--sand8);   }
.chip--info { border-color: var(--sky7); background: var(--sky2); color: var(--info); }
.chip--muted { border-color: var(--sand8);   }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: none; display: inline-block; }

/* ---------- 4 顶栏 ---------- */
.topbar {
  position: fixed; inset: env(safe-area-inset-top) 0 auto; z-index: 30;
  display: grid; grid-template-columns: minmax(272px, 330px) minmax(250px, 340px) minmax(0, 1fr);
   align-items: start;  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.player {
  display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 12px 8px 8px;
  border: 1px solid var(--wood-dark); border-radius: var(--r-sm);
  background: var(--paper) var(--grain); background-size: 6px 6px;
  box-shadow: none;
}
.avatar { position: relative; flex: 0 0 62px; width: 62px; height: 62px; padding: 0; border-radius: var(--r-sm);   }
.avatar img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--r-sm); }

.player-info { flex: 1; min-width: 0; display: grid; gap: 1px; }
.player-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.level-chip { flex: 0 0 auto; padding: 0 7px; border-radius: 999px;     font-weight: 800; line-height: 1.7; box-shadow: none; }
.farm-brand {  line-height: 1.1;  text-shadow: none; }
.player-info strong { display: block; min-width: 0;  }
#player-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account { display: block; color: var(--ink-soft); font-size: var(--text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
progress { display: block; width: 100%; height: 9px; margin: 2px 0 1px;  border-radius: 999px;  overflow: hidden; }

progress::-webkit-progress-value {  box-shadow: none; }

.wallet {
  display: grid; grid-template-columns: repeat(2, max-content); justify-content: start; gap: 6px; min-width: max-content;
  padding: 8px 9px; border: 1px solid var(--wood-dark); border-radius: var(--r-sm);
  background: var(--paper) var(--grain); background-size: 6px 6px;
  box-shadow: none;
}
.asset { display: flex; align-items: center; gap: 7px; width: auto; min-width: max-content; flex-shrink: 0; padding: 3px 4px; border-radius: var(--r-sm); text-align: left; }
.asset:hover { background: var(--sandA3); }
.asset img { width: 30px; height: 30px; object-fit: contain; filter: none; flex: 0 0 30px; }
.asset-text { min-width: max-content; flex: 0 0 auto; display: grid; line-height: 1.15; }
.asset-text small { color: var(--ink-faint); font-size: var(--text-sm); font-weight: 700; }
.asset-text strong { font-size: var(--text-title); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: visible; text-overflow: clip; }
.asset--gem .asset-text strong { color: var(--sky11); }
.asset--coin .asset-text strong { color: var(--sand12); }
.asset-go { width: 14px; height: 14px; color: var(--ink-faint); flex: 0 0 14px; }
.meter-pill {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-height: 30px;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--amber7);
  background: var(--sand2); text-align: left;
}
.meter-pill:hover { border-color: var(--gold-dark); }
.meter-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.meter-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.meter-track { display: block; height: 7px; border-radius: 999px;  box-shadow: none; overflow: hidden; }
.meter-track > span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--sky6); box-shadow: none; transition: none; }
#production-copy { font-size: var(--text-sm); color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-nav { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.hud-nav button {
  display: flex; align-items: center; gap: 7px; min-height: 52px; padding: 5px 12px 5px 6px;
     font-weight: 800; font-size: var(--text-base);
  
   
  white-space: nowrap;
}
.hud-nav button:hover { filter: brightness(1.08); }
.hud-nav button:active { transform: none; box-shadow: none; }
.nav-emblem {
  display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; 
  
  
}
.nav-emblem img { width: 30px; height: 30px; object-fit: contain; }

/* ---------- 5 场景 ---------- */
.viewport { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; background: #829744; touch-action: none; cursor: grab; }
.world { position: absolute; left: 0; top: 0; width: 2048px; height: 1248px; transform-origin: top left; will-change: transform; contain: layout style; background: url("assets/scene-20261025/terrain.webp") center/100% 100% no-repeat; }
.world.is-overview #scene-markers { visibility: hidden; }
#theme-art { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#theme-art .theme-art { display: block; width: 100%; height: 100%; animation: none; }
.theme-art-native-canvas { position: absolute; inset: 0; display: block; }
.theme-preview-holder { width: 244px; height: 108px; }
.theme-art-preview { position: relative; display: block; width: 244px; height: 108px; }
.theme-art-preview img { position: absolute; display: block; object-fit: contain; }
@media (prefers-reduced-motion: reduce) { #theme-art .theme-art { animation: none; } }
@keyframes theme-fade { from { opacity: 0; } to { opacity: 1; } }
.scene-layer, .house { position: absolute; pointer-events: none; }
.scenery, .building { position: absolute; padding: 0; border: 0; background: transparent; }
.building { cursor: pointer; }
.building img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; transition: none; }
.building::before {
  content: ""; position: absolute; inset: -6% -6% -10%; border-radius: var(--r-sm);
  background: var(--sandA8);
  opacity: 0; transition: none; pointer-events: none;
}
.building:hover::before, .building:focus-visible::before { opacity: 1; }
.building:hover img, .building:focus-visible img { filter: brightness(1.07) drop-shadow(0 4px 8px var(--sandA8)); }
.building-name {
  position: absolute; left: 50%; bottom: -16px; 
    
   
   letter-spacing: 0;
  white-space: nowrap; pointer-events: none;
   
}

.building.scenery .building-name { opacity: 0; transform: translateX(-50%) translateY(4px); transition: none; }
.building.scenery:hover .building-name, .building.scenery:focus-visible .building-name { opacity: .95; transform: translateX(-50%) translateY(0); }
.plot { position: absolute; min-height: 0; padding: 0; border: 0; background: transparent; border-radius: var(--r-sm); }
.plot .soil { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: none; }
.plot .crop {
  position: absolute; object-fit: contain; transform: none;
  transform-origin: 50% 100%; 
  filter: none;
  transition: none;
}
.plot:focus-visible .crop { transform: scale(1.025); }
.plot:focus-visible .soil { filter: brightness(1.12) drop-shadow(0 3px 0 var(--sandA6)); }
@media (hover: hover) and (pointer: fine) {
  .plot:hover .crop { transform: scale(1.025); }
  .plot:hover .soil { filter: brightness(1.12) drop-shadow(0 3px 0 var(--sandA6)); }
}
.plot.inspected {  outline-offset: -1px; box-shadow: none; }
.plot.locked { cursor: default; }
.plot.locked .soil { opacity: .16; filter: grayscale(.5) brightness(1.02) contrast(.9); mix-blend-mode: multiply; }
.plot.locked:hover .soil, .plot.locked:focus-visible .soil { opacity: .24; }
.plot.locked::after {
  content: ""; position: absolute; inset: 12% 14%; border-radius: var(--r-sm);
  border: 1px dashed var(--sandA8); opacity: 0; transition: none;
}
.plot.locked:hover::after, .plot.locked:focus-visible::after { opacity: 1; }
.plot-next .soil { opacity: .55; }

.plot-bar { position: absolute; left: 50%; top: 72%; width: 42px; height: 5px; transform: translateX(-50%); border: 1px solid #fff1b85c; border-radius: 999px; overflow: hidden; pointer-events: none; }
.plot-bar > span { display: block; height: 100%; width: 100%; border-radius: 999px; transform: scaleX(0); transform-origin: left center; box-shadow: none; }
.plot-bar--ready > span { background: var(--amber4); }

.plot-badge .ui-icon { width: 12px; height: 12px; }

.plot.watering::after, .plot.caring::after {
  content: ""; position: absolute; inset: -6px; border-radius: var(--r-sm); pointer-events: none;
  box-shadow: none; 
}
.scene-controls {
  position: absolute; left: 12px; bottom: 10px; z-index: 16;
  display: flex; align-items: center; gap: 4px; padding: 4px 6px;
   
    
}
.scene-controls .ui-icon { width: 18px; height: 18px; color: var(--ink-soft); }
.scene-zoom { display: flex; align-items: center; gap: 5px; padding: 0 4px; font-size: var(--text-sm); color: var(--ink-soft); }
.scene-zoom-label { font-weight: 700; }
.scene-zoom input { width: 88px; }
.scene-btn {  padding: 3px 10px; border-radius: var(--r-sm); font-size: var(--text-base); font-weight: 700;     }

.crop-info {
  position: absolute; right: 12px; bottom: 10px; z-index: 18; width: 336px; max-width: calc(100% - 24px);
  max-height: calc(100% - 16px); overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--wood-dark); border-radius: var(--r-sm); padding: 0;
  background: var(--paper) var(--grain); background-size: 6px 6px;
  box-shadow: none;
}
.crop-info header { display: flex; align-items: center; gap: 8px; padding: 10px 12px;   border-radius: var(--r-sm); position: sticky; top: 0; z-index: 1; }
.crop-info header .crop-avatar { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--sand2); box-shadow: none; }
.crop-info header img { width: 100%; height: 100%; object-fit: contain; }
.crop-info header strong { font-size: var(--text-title); }
.crop-info header small { color: var(--ink-faint); font-size: var(--text-sm); }
.small-close { width: 40px; height: 40px; min-height: 40px; flex: 0 0 40px; margin-left: auto; border-radius: 50%; border: 1px solid var(--amber11); background: var(--amber2); color: var(--ink-soft); font-size: var(--text-display); line-height: 1; }
.crop-info .crop-body { padding: 10px 12px 12px; display: grid;  }
.crop-info .crop-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.crop-info .crop-stat { background: var(--amber2); border: 1px solid var(--sand7); border-radius: var(--r-sm); padding: 5px 8px; }
.crop-info .crop-stat small { display: block; color: var(--ink-faint); font-size: var(--text-sm); }
.crop-info .crop-stat strong { font-size: var(--text-base); font-variant-numeric: tabular-nums; }
.crop-info .crop-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.crop-info .crop-actions .action-button, .crop-info .crop-actions .plain-button { flex: 1 1 44%; }
.crop-info p { margin: 0; font-size: var(--text-base); color: var(--ink-soft); }
.crop-info .crop-note { border-top: 1px dashed var(--paper-line); padding-top: 8px; }
.season-pips { display: flex; gap: 4px; align-items: center; }
.season-pip { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--amber11); background: var(--sand5); }
.season-pip.is-done { background: var(--amber8); }
.season-pip.is-now { background: var(--amber5); box-shadow: none; }
.scene-notices {
  position: fixed; top: calc(var(--hud-height) + 8px); left: 50%; transform: translateX(-50%); z-index: 24;
  width: min(660px, calc(100% - 24px)); max-height: 32dvh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.scene-notices > * { pointer-events: auto; flex-shrink: 0; }
.task-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.task-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 6px;
   border-radius: 999px; 
   font-size: var(--text-base); font-weight: 700; 
}
.task-chip:hover { border-color: var(--leaf); background: var(--sand2); }
.task-chip .task-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--sand5); }
.task-chip .task-icon .ui-icon { width: 15px; height: 15px; }
.task-chip--ready { border-color: var(--amber11);  }
.task-chip--ready .task-icon { background: var(--amber5); }
.task-chip--care { border-color: var(--grass8); }
.task-chip--care .task-icon { background: var(--grass4); }
.task-chip--hazard { border-color: var(--tomato9); background: var(--sand3); }
.task-chip--hazard .task-icon { background: var(--sand4); }
.task-chip small { color: var(--ink-faint); font-weight: 600; }
.status {
  align-self: center; max-width: 100%; margin: 0; padding: 6px 14px;
  border: 1px solid var(--amber12); border-radius: 999px; background: var(--sand1);
  color: var(--ink); font-size: var(--text-base); font-weight: 600; box-shadow: none;
  overflow-wrap: anywhere; text-align: center;
}
.status:empty { display: none; }
.danger, .status.error { color: var(--danger); }
.help { align-self: center; margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--sandA11); color: var(--amber2); font-size: var(--text-sm); pointer-events: none; text-align: center; }
.help:empty { display: none; }
.visit-banner, .operation-status {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px;
  border: 1px solid var(--amber12); border-radius: var(--r-sm); background: var(--paper); box-shadow: none;
}
.visit-banner span, .operation-status span { font-size: var(--text-base); font-weight: 700; }
.visit-banner .visit-note { flex: 1 1 240px; color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.5; }

.farm-source-cursor { position: fixed; z-index: 45; pointer-events: none; background-repeat: no-repeat; }

/* ---------- 6 底栏 ---------- */
.toolbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: flex-end; justify-content: safe center; gap: 2px;
  padding: 6px max(10px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-bottom));
  
  
  
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
}
.tool-group { display: flex; align-items: flex-end; gap: 2px; }
.tool-sep {  height: 54px; margin: 0 7px; align-self: center;  border-radius: var(--r-sm); }
.toolbar button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  flex: 0 0 70px; width: 70px; height: 78px; padding: 0 2px 4px;
    background: transparent;
  transition: none;
}
.toolbar button img { width: 52px; height: 48px; object-fit: contain; pointer-events: none; filter: none; }
.toolbar .tool-name {
  position: static;  
  font: 700 var(--text-base)/1.35 "Microsoft YaHei", sans-serif !important; white-space: nowrap; margin-top: 1px;
}
.toolbar button[aria-pressed="true"] {
  border-color: var(--amber5); background: var(--sandA8);
  box-shadow: none;
}
.toolbar button[aria-pressed="true"] .tool-name { color: var(--amber3) !important; }

.toolbar button:active { transform: none; }

/* ---------- 7 菜单 ---------- */
.game-menu {
  position: fixed; inset: auto 12px calc(var(--tools-height) + 8px) auto; margin: 0;
  width: min(560px, calc(100% - 24px)); max-height: min(70dvh, 640px); overflow: auto;
  padding: 0 0 10px;  
   
  
}
.game-menu:popover-open { display: block; animation: none; }
.game-menu--account { top: calc(var(--hud-height) + 6px); bottom: auto; }
.menu-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
   border-bottom: 1px solid var(--sand12); border-radius: var(--r-sm);
  background: var(--amber11); box-shadow: none;
}
.menu-title { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-size: var(--text-title);  text-shadow: none; }
.menu-close { width: 40px; height: 40px; min-height: 40px; border-radius: 50%; border: 1px solid var(--sand12); background: var(--amber4); color: var(--sand12); font-size: var(--text-title); line-height: 1; }

.menu-group h3 { display: flex; align-items: center; gap: 6px; margin: 2px 4px 8px; color: var(--wood-dark); font-size: var(--text-base); letter-spacing: 0; }
.menu-group h3 .ui-icon { width: 18px; height: 18px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));  }
.menu-grid button {
  display: flex; align-items: center; gap: 8px;  padding: 6px 10px;
   border-radius: var(--r-sm); 
   font-weight: 700; font-size: var(--text-base); text-align: left;
  
}
.menu-grid button:hover { border-color: var(--leaf-2);  }
.menu-grid button:active { transform: none; box-shadow: none; }
.menu-grid .ui-icon { width: 26px; height: 26px; flex: 0 0 26px; }

/* ---------- 8 弹窗 ---------- */
dialog {
   max-height: calc(100dvh - 28px); padding: 0;
    
  color: var(--ink);  overflow: hidden;
}
dialog[open] { display: flex; flex-direction: column; animation: none; }

.panel-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px;
  background: var(--amber11); border-bottom: 1px solid var(--sand12);
  box-shadow: none; position: relative;
}

.panel-heading { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.panel-kicker { color: var(--sand5); font-size: var(--text-sm); font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
dialog h1 { font-size: var(--text-display); line-height: 1.4; padding: 1px 0 2px; color: var(--amber2); text-shadow: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-icon-btn {
  flex: 0 0 40px; width: 40px; height: 40px; min-height: 40px; border-radius: 50%;
  border: 1px solid var(--sand12); background: var(--amber4); color: var(--sand12);
  font-size: var(--text-display); line-height: 1; font-weight: 700;
  box-shadow: none;
}
.panel-icon-btn:active { transform: none; box-shadow: none; }
.panel-close { font-size: var(--text-display); }
#panel-tabs {
  flex: 0 0 auto; display: flex;  overflow-x: auto; 
    scrollbar-width: thin;
}
#panel-tabs button {
  flex-shrink: 0;  padding: 4px 13px; 
    
  font-size: var(--text-base); font-weight: 700;
}
#panel-tabs button:hover { border-color: var(--leaf-2); color: var(--leaf); }
#panel-tabs button[aria-current="page"] {
  border-color: var(--amber12); color: var(--amber2); background: var(--grass8);
  box-shadow: none;
}
#panel-content {  overflow-y: auto; min-height: 0; overscroll-behavior: contain;   }
#panel-content > * { max-width: 100%; }
.panel-connection {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 7px 14px;
   border-bottom: 1px solid var(--amber7); 
  font-size: var(--text-sm); font-weight: 700; line-height: 1.5;
}
.panel-connection[data-phase="offline"] { background: var(--sand4); border-bottom-color: var(--sand7); color: var(--danger); }
.panel-connection[hidden] { display: none; }
#panel-content:focus { outline: none; }
#panel-feedback {
  flex-shrink: 0; max-height: 18dvh; overflow: auto; margin: 0; padding: 9px 16px;
  background: var(--amber3); border-top: 1px solid var(--amber7); font-size: var(--text-base); font-weight: 600;
  color: var(--wood-dark);
}
#panel-feedback.danger { background: var(--danger-soft); color: var(--danger); border-top-color: var(--sand7); }
#panel-recovery { flex-shrink: 0; padding: 0 16px 12px; margin: 0; }
#confirmation { width: min(520px, calc(100% - 24px)); }
#confirmation-copy {
  margin: 0; padding: 14px 18px 4px; color: var(--ink-soft);
  font-size: var(--text-base); line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere;
}
#confirmation > .panel-actions { margin: 0; padding: 12px 18px 16px; justify-content: flex-end; }
#confirmation > .panel-actions .action-button, #confirmation > .panel-actions .plain-button { min-width: 104px; }
.catalog-controls {
  display: flex; flex-shrink: 0; gap: 10px 16px; flex-wrap: wrap; align-items: flex-end;
    
}
.catalog-field { display: flex; flex-direction: column;  font-size: var(--text-sm); font-weight: 700; color: var(--ink-faint); }
.catalog-field select, .catalog-field input { min-height: 38px; font-size: var(--text-base); }
.catalog-field--search { position: relative; flex: 1 1 220px; }
.catalog-field--search .ui-icon { position: absolute; left: 10px; bottom: 10px; width: 18px; height: 18px; color: var(--ink-faint); pointer-events: none; }
.catalog-field--search input { padding-left: 34px; width: 100%; }
#catalog-search { width: 220px; }

/* ---------- 9 组件 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));  }
.stat {
  display: flex; align-items: center; gap: 9px; 
   
   
}
.stat-icon { width: 30px; height: 30px; flex: 0 0 30px; }
.stat-body { min-width: 0; display: grid; line-height: 1.2; }
.stat-label { color: var(--ink-faint); font-size: var(--text-sm); font-weight: 700; }
.stat-value {  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-sub { color: var(--ink-faint); font-size: var(--text-sm); }
.stat--gem { border-color: var(--sky6); background: var(--sky1); }
.stat--leaf { border-color: var(--grass7); background: var(--grass2); }
.stat--gold { border-color: var(--amber7); background: var(--sand2); }
.stat--danger { border-color: var(--sand7); background: var(--sand2); }
.ui-block { margin: 0 0 24px; }
.ui-block-head { display:flex; align-items:center; gap:12px; flex-wrap:wrap;  border-bottom:1px solid var(--sand6); }
.ui-block-titles { flex: 1 1 180px; min-width: 0; display: grid; gap: 1px; }
.ui-block-title { display: flex; align-items: center; gap: 8px; font-size: var(--text-title); color: var(--wood-dark); }
.ui-block-title .ui-icon { width: 24px; height: 24px; }
.ui-block-sub { margin: 0; color: var(--ink-faint);  }
.ui-block-aside { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ui-block-body { display:grid; gap:16px;  }
.ui-block-body > p { margin: 0; }
.ui-hero { display:flex; align-items:center; gap:20px; flex-wrap:wrap; margin:0 0 20px; padding:0 0 20px; border-bottom:1px solid var(--sand6); }

.ui-hero-art { position: relative; flex: 0 0 104px;   display: grid; place-items: center; }
.ui-hero-art img { width: 100%; height: 100%; object-fit: contain; filter: none; }
.ui-hero-art--icon { border-radius: var(--r-sm);  box-shadow: none; }
.hero-icon { width: 62px !important; height: 62px !important; }
.ui-hero-body { flex: 1 1 240px; min-width: 0; display: grid;  z-index: 1; }
.ui-hero-kicker { color: var(--gold-dark); font-size: var(--text-sm); font-weight: 800; letter-spacing: 0; }
.ui-hero-title {  color: var(--wood-dark); }
.ui-hero-sub { margin: 0; color: var(--ink-soft);  line-height: 1.6; }
.ui-hero-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.ui-hero-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; z-index: 1; }
.ui-progress { display: grid; gap: 3px; }
.ui-progress-track {     overflow: hidden; }
.ui-progress-fill { display: block; height: 100%; width: 0; border-radius: 999px;   transition: none; }
.ui-progress-copy { color: var(--ink-faint);  font-variant-numeric: tabular-nums; }

.ui-progress--danger .ui-progress-fill { background: var(--sand6); }
.ui-progress--compact .ui-progress-copy { font-size: var(--text-sm); }
.ui-stepper { display: inline-flex; align-items: center; gap: 0;    overflow: hidden; }
.ui-stepper .stepper-btn { width: 40px; height: 40px; min-height: 40px; font-size: var(--text-title); font-weight: 800; color: var(--wood-dark);  }
.ui-stepper .stepper-btn:hover { background: var(--amber3); }
.ui-stepper .stepper-input { width: 66px; min-height: 40px; border: 0; border-radius: var(--r-sm); box-shadow: none; background: var(--sand2); text-align: center; font-weight: 700; }
.ui-stepper .stepper-input::-webkit-outer-spin-button, .ui-stepper .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ui-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: var(--text-base); font-weight: 600; }
.ui-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ui-switch-track { position: relative; width: 46px; height: 26px; border-radius: 999px; background: var(--sand8); box-shadow: none; transition: none; flex: 0 0 46px; }
.ui-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--sand2); box-shadow: none; transition: none; }
.ui-switch input:checked + .ui-switch-track { background: var(--grass8); }
.ui-switch input:checked + .ui-switch-track::after { transform: translateX(20px); }
.ui-switch input:focus-visible + .ui-switch-track { outline: 3px solid var(--sky11); outline-offset: 2px; }
.ui-empty { display: grid; justify-items: center; gap: 6px; padding: 18px 12px 20px; text-align: center; }
.ui-empty-art { width: min(220px, 70%);  }
.ui-empty-art svg { width: 100%; height: auto; display: block; }
.ui-empty-title { font-size: var(--text-title); color: var(--wood-dark); }
.ui-empty-copy { margin: 0; max-width: 40ch; color: var(--ink-soft); font-size: var(--text-base); }
.ui-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.ui-row {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--sand7); border-radius: var(--r-sm);
  background: var(--sand2);
}
.ui-row + .ui-row { margin-top: 8px; }
.ui-row-art { flex: 0 0 54px;   display: grid; place-items: center; border-radius: var(--r-sm); background: var(--sand2); box-shadow: none; }
.ui-row-art img { width: 100%; height: 100%; object-fit: contain; }
.ui-row-art--icon .ui-icon, .ui-row-art--icon .ui-item-art { width: 70%; height: 70%; }
.ui-row-body { flex: 1 1 200px; min-width: 0; display: grid; gap: 2px; }
.ui-row-title { font-size: var(--text-base); }
.ui-row-sub { margin: 0; color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.5; }
.ui-row-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ui-row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.ui-row--ready { border-color: var(--amber8); background: var(--sand2); }
.ui-row--danger { border-color: var(--sand7); background: var(--sand2); }
.ui-row--locked { opacity: .78; background: var(--sand3); }
.ui-field { display: grid; gap: 3px; font-size: var(--text-sm); font-weight: 700; color: var(--ink-faint); }
.ui-field-label { padding-left: 2px; }
.ui-segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px;    }
.ui-segment { display: inline-flex; align-items: center; gap: 5px;  padding: 3px 11px;  color: var(--ink-soft); font-size: var(--text-base); font-weight: 700; }
.ui-segment .ui-icon { width: 16px; height: 16px; }
.ui-segment:hover { background: var(--amber2); }

.ui-cost { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; }
.cost-icon { width: 17px; height: 17px; }
.cost-text { font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft); }
.ui-cost .cost-text + .cost-icon { margin-left: 4px; }
.ui-price { display: inline-flex; align-items: center; gap: 4px;      }
.ui-price .price-icon { width: 17px; height: 17px; }
.ui-price strong { font-size: var(--text-base); font-variant-numeric: tabular-nums; }
.ui-price small { font-size: var(--text-sm); font-weight: 700; }
.ui-section-title { display: flex; align-items: center; gap: 7px; margin: 2px 0; color: var(--wood-dark); }
.ui-section-title h3 { font-size: var(--text-base); }
.ui-section-title .ui-icon { width: 20px; height: 20px; }
.ui-section-title > :last-child:not(h3) { margin-left: auto; }

/* ---------- 10 面板通用 ---------- */
.panel-note, .panel-description { color: var(--ink-soft); font-size: var(--text-base); line-height: 1.65; }
.panel-note { margin: 0 0 10px; }
.panel-note.danger { color: var(--danger); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.panel-toolbar { display: flex; flex-wrap: wrap;  align-items: center; margin: 0 0 14px; }
.spacer { flex: 1; }
.pagination { display: flex;  align-items: center; gap: 10px;  flex-wrap: wrap; }
.pagination > span { font-size: var(--text-base); font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.items { display: grid;   }
.item { position:relative; min-width:0; display:flex; flex-direction:column;   border-bottom:1px solid var(--sand6);  }
.item:hover { border-color:var(--grass8); }
.item-art {
  position: relative; display: grid; place-items: center;  
  
  
}
.item-art img {   object-fit: contain;  }

.item-art .item-count {
  position: absolute; right: 5px; bottom: 4px; padding: 0 7px; border-radius: 999px;
  background: var(--sandA11); color: var(--amber2); font-size: var(--text-sm); font-weight: 800; font-variant-numeric: tabular-nums;
}
.item-art .item-flag { position: absolute; left: 5px; top: 5px; max-width: calc(100% - 10px); }
.item-art .item-flag .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.item h2, .item-name { font-size: var(--text-title); line-height: 1.3; }
.item .item-meta { display: flex; flex-wrap: wrap;  }
.item p { margin: 0;  color: var(--ink-soft); }
.item .item-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.item .action-button, .item .plain-button { width: 100%;  white-space: normal; }
.item .quantity, .item .ui-stepper { align-self: center; }
.item-locked { border-color: var(--sand8);  }
.item-locked::after {
  content: "已锁定"; position: absolute; top: 8px; right: 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--sand1); color: var(--amber3); font-size: var(--text-sm); font-weight: 800;
}
.item-selected {  box-shadow: none; }
.item-selected::before {
  content: "已选择"; position: absolute; top: 8px; left: 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--leaf); color: var(--amber2); font-size: var(--text-sm); font-weight: 800; z-index: 2;
}
.selection-label { color: var(--leaf); font-weight: 800; }
.art-missing { display: grid; place-items: center; width: 100%; height: 100%; color: var(--ink-faint); font-size: var(--text-sm); text-align: center; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 26px 12px; color: var(--ink-soft); text-align: center; }
.empty .empty-title { font-size: var(--text-title); font-weight: 800; color: var(--wood-dark); }
.row { padding: 12px 14px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand1); }
.row + .row { margin-top: 8px; }
.row:first-child { margin-top: 0; }
.row h2 { margin: 0 0 4px; font-size: var(--text-title); }
.row p { margin: 3px 0; font-size: var(--text-base); color: var(--ink-soft); }
.row button, .row input, .row select { margin: 4px 4px 0 0; }
.row-copy { min-width: 0; }
.resource-line { padding: 12px 0; border-bottom: 1px dashed var(--sand7); display: grid; gap: 6px; }
.resource-line:first-child { padding-top: 0; }
.resource-line h3 { font-size: var(--text-title); margin: 0; }
.resource-line p { margin: 0; font-size: var(--text-base); color: var(--ink-soft); }
.resource-line > strong { font-size: var(--text-base); }
.resource-line > button, .resource-line > input { justify-self: start; }
.resource-line .quantity { width: 88px; }
.field-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px;
  border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand1);
}
.field-row + .field-row { margin-top: 8px; }
.field-row > div { flex: 1 1 180px; min-width: 0; }
.field-row p { margin: 2px 0; font-size: var(--text-sm); color: var(--ink-soft); }
.field-row img { width: 48px; height: 48px; object-fit: contain; }
.build-settings-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.build-settings-table th, .build-settings-table td { border-bottom: 1px solid var(--sand7); padding: 7px 6px; text-align: left; }
.build-settings-table th:first-child { width: 52%; }
.build-settings-table label { display: flex; min-height: 40px; align-items: center; }
.build-settings-table small { display: block; color: var(--ink-faint); font-size: var(--text-sm); }

.check-label { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 3px 8px; border-radius: var(--r-sm); font-size: var(--text-base); }
.check-label:hover { background: var(--amber3); }
.scope-options { max-height: 240px; overflow-y: auto; padding: 6px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px; }
.panel-section { margin: 0 0 14px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sandA11); overflow: hidden; }
.panel-section > summary {  font-weight: 800; font-size: var(--text-base); color: var(--wood-dark);  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.panel-section > summary::-webkit-details-marker { display: none; }
.panel-section > summary::before { content: "▸"; font-size: var(--text-sm); color: var(--ink-faint); transition: none; }
.panel-section[open] > summary::before { transform: rotate(90deg); }
.panel-section > *:not(summary) { margin: 0; padding: 10px 14px; }
.panel-section > p { font-size: var(--text-base); color: var(--ink-soft); }
.quota-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 10px; }
.quota-table > div { display: grid; gap: 2px; padding: 9px 11px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.quota-table dt { color: var(--ink-faint); font-size: var(--text-sm); font-weight: 700; }
.quota-table dd { margin: 0; font-size: var(--text-title); font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.entry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.entry-list li {
  display: grid; gap: 2px; padding: 9px 11px; border: 1px solid var(--sand7); border-radius: var(--r-sm);
  background: var(--sand2); overflow-wrap: anywhere;
}
.entry-list time { color: var(--ink-faint); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.entry-list strong { font-size: var(--text-base); }
.entry-list div { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.55; }
.exchange-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 10px; margin: 0 0 12px; }
.exchange-option {
  display: grid; gap: 6px; align-content: start; padding: 12px;  border-radius: var(--r-sm);
  
}
.exchange-option .preset-amount { display: flex; align-items: center; gap: 7px; font-size: var(--text-base); font-weight: 700; color: var(--sky11); }
.exchange-option .preset-amount .ui-icon { width: 24px; height: 24px; }
.exchange-option .preset-value { font-size: var(--text-title); font-weight: 800; color: var(--sky12); }
.exchange-option p { margin: 0; font-size: var(--text-sm); color: var(--ink-faint); }
.exchange-option .action-button { width: 100%; }
.land-expand-dialog { width: min(620px, calc(100% - 24px)); }
.land-expand-dialog .panel-head h1 { font-size: var(--text-title); }
.land-expand-body { padding: 14px 16px; overflow-y: auto; display: grid; gap: 8px; }
.land-expand-body p { margin: 0; font-size: var(--text-base); color: var(--ink-soft); }
.land-expand-dialog > .panel-actions { flex-shrink: 0; padding: 10px 16px 14px; margin: 0; justify-content: flex-end; }
.land-expansion-error { color: var(--danger); font-weight: 700; }
.owned-prop { position: absolute; padding: 0; border: 0; background: transparent; pointer-events: auto; }
.owned-prop-art { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.owned-prop::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: 1%; height: 9%; border-radius: 50%; background: radial-gradient(ellipse, #46542445, #52642b20 50%, #52642b00 73%); pointer-events: none; }
.owned-prop--stone_path::after { display: none; }
.owned-prop-tooltip { position: absolute; left: 50%; bottom: calc(100% - 5px); z-index: 5; display: block; padding: 5px 10px; border: 1px solid #b68a4d; border-radius: 5px 9px 7px 4px; background: linear-gradient(#fff0c9, #e7c58b); color: #603d1f; font-size: var(--text-sm); font-weight: 700; white-space: nowrap; opacity: 0; transform: translate(-50%, 4px); transition: opacity 160ms ease, transform 160ms ease; pointer-events: none; box-shadow: 0 3px 6px #3f2c1c29; }
.owned-prop:hover .owned-prop-tooltip, .owned-prop:focus-visible .owned-prop-tooltip, body.decor-management .owned-prop-tooltip { opacity: 1; transform: translate(-50%, 0); }
.owned-prop:hover .owned-prop-art { filter: brightness(1.035); }
.owned-prop:focus-visible { outline: 2px solid #fff1b5; outline-offset: 3px; border-radius: 6px; }
.windmill-rotor-frame { position: absolute; z-index: 2; left: 0; top: 50%; width: 100%; aspect-ratio: 1; transform: translateY(-50%); pointer-events: none; }
.windmill-rotor { display: block; width: 100%; height: 100%; transform-origin: 48.37155% 42.43725%; animation: windmill-turn 24s linear infinite; }
.owned-prop--scarecrow .owned-prop-art { transform-origin: 50% 100%; animation: field-breeze 6s ease-in-out infinite; }
.owned-prop--guild_banner .owned-prop-art { transform-origin: 32% 100%; animation: banner-breeze 5s ease-in-out infinite; }
.windmill-rotor, .owned-prop--scarecrow .owned-prop-art, .owned-prop--guild_banner .owned-prop-art, #building-dog .guardian-scene-art { will-change: transform; }
@keyframes windmill-turn { to { transform: rotate(360deg); } }
@keyframes field-breeze { 50% { transform: rotate(-1deg); } }
@keyframes banner-breeze { 50% { transform: skewY(-1.1deg); } }
.guardian-contact { position: absolute; z-index: 0; pointer-events: none; border-radius: 50%; background: radial-gradient(ellipse, #40502059 0, #52642b3d 39%, #52642b00 72%); }
.guardian-contact--dog { left: 30%; width: 37%; bottom: 8%; height: 11%; }
.guardian-contact--kennel { left: 16%; width: 68%; bottom: 3%; height: 15%; }
.guardian-scene-art { position: absolute; inset: 0; display: block; z-index: 1; }
#building-dog .guardian-scene-art { transform-origin: 48% 91%; animation: guardian-breathe 4.6s ease-in-out infinite; }
@keyframes guardian-breathe { 50% { transform: scaleY(.986) translateY(1px); } }
.native-prop-preview { display: block; width: 100%; height: 100%; object-fit: contain; }
.decor-preview:has(.native-prop-preview) { background: radial-gradient(ellipse at 50% 85%, #dfe3bd 0, #f4e9c9 65%); }
@media (prefers-reduced-motion: reduce) { .owned-prop-art, .windmill-rotor, #building-dog .guardian-scene-art { animation: none !important; } }
.guard-dog { display: inline-block; position: relative; width: 100%; height: 100%; }
.guard-dog > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.row .guard-dog { width: 86px; height: 86px; }
.guard-kennel-art { width: 100%; height: 100%; object-fit: contain; }

/* ---------- 11 响应式 ---------- */
@media (max-width: 1240px) {
  .topbar { grid-template-columns: minmax(240px, 300px) minmax(230px, 300px) minmax(0, 1fr); gap: 8px; padding-inline: 10px; }
  .hud-nav button { padding: 4px 9px 4px 5px; font-size: var(--text-base); }
  .nav-emblem { width: 34px; height: 34px; flex-basis: 34px; }
  .nav-emblem img { width: 26px; height: 26px; }
}
@media (max-width: 1020px) {
  .topbar { grid-template-columns: minmax(0, 1fr) minmax(210px, 42%); row-gap: 6px; }
  .player { min-width: 0; }
  .hud-nav { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .hud-nav::-webkit-scrollbar { display: none; }
  .hud-nav button { flex: 0 0 auto; }
  .game-menu--account { top: auto; bottom: calc(var(--tools-height) + 8px); }
  .items { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  dialog { width: min(920px, calc(100% - 20px)); }
}
@media (min-width: 721px) and (max-width: 1020px) {
  .toolbar { padding-inline: 6px; }
  .toolbar button { width: 64px; flex-basis: 64px; }
  .toolbar button img { width: 46px; height: 42px; }
  .tool-sep { margin: 0 3px; }
}
@media (max-width: 720px) {
  .topbar { padding: 6px 6px 0; gap: 5px; grid-template-columns: minmax(0, 1fr) minmax(168px, 44%); }
  .player { padding: 5px 8px; gap: 7px; border-radius: var(--r-sm); }
  .avatar { flex-basis: 46px; width: 46px; height: 46px; }
  .avatar-level { font-size: var(--text-sm); padding: 0 5px; right: -4px; bottom: -5px; }
  .farm-brand { font-size: var(--text-title); }
  .player-info strong { font-size: var(--text-sm); }
  #account { font-size: var(--text-sm); }
  .wallet { padding: 5px 6px; border-radius: var(--r-sm); gap: 3px; }
  .asset { padding: 2px; gap: 4px; }
  .asset img { width: 22px; height: 22px; flex-basis: 22px; }
  .asset-text small { font-size: var(--text-sm); }
  .asset-text strong { font-size: var(--text-base); }
  .asset-go { display: none; }
  .meter-pill { min-height: 26px; padding: 2px 7px; gap: 5px; }
  .meter-icon { width: 15px; height: 15px; flex-basis: 15px; }
  #production-copy { font-size: var(--text-sm); }
  .hud-nav { gap: 5px; }
  .hud-nav { gap: 3px; overflow: visible; }
  .hud-nav button { flex: 1 1 0; min-width: 0; width: auto; min-height: 50px; padding: 3px 2px; font-size: var(--text-sm); border-radius: var(--r-sm); gap: 1px; flex-direction: column; }
  .hud-nav button > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-emblem { width: 28px; height: 28px; flex-basis: 28px; border-radius: var(--r-sm); }
  .nav-emblem img { width: 22px; height: 22px; }
  .scene-controls { left: 6px; bottom: 6px; padding: 3px 4px; gap: 2px; border-radius: var(--r-sm); }
  .scene-zoom input { width: 64px; }
  .scene-btn { min-height: 34px; padding: 3px 8px; font-size: var(--text-sm); }
  .scene-zoom-label { display: none; }
  .crop-info { left: 6px; right: 6px; bottom: 56px; width: auto; max-width: none; max-height: calc(100% - 62px); border-radius: var(--r-sm); }
  .scene-notices { top: calc(var(--hud-height) + 6px); width: calc(100% - 12px); max-height: 30dvh; }
  .task-strip { gap: 4px; }
  .task-chip { font-size: var(--text-sm); padding: 3px 9px 3px 5px; }
  .task-chip .task-icon { width: 19px; height: 19px; }
  .task-chip .task-icon .ui-icon { width: 13px; height: 13px; }
  .help { font-size: var(--text-sm); }
  .toolbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 4px 4px max(4px, env(safe-area-inset-bottom)); overflow: visible; }
  .tool-group { display: contents; }
  .tool-sep { display: none; }
  .toolbar button { width: auto; flex-basis: auto; height: 62px; padding: 0 1px 3px; border-radius: var(--r-sm); }
  .toolbar button img { width: 40px; height: 36px; }
  .toolbar .tool-name { font-size: var(--text-sm) !important; }
  .game-menu { inset: auto 6px calc(var(--tools-height) + 6px) 6px; width: auto; max-height: 66dvh; border-radius: var(--r-sm); }
  .game-menu--account { top: calc(var(--hud-height) + 4px); bottom: auto; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-grid button { min-height: 44px; font-size: var(--text-sm); padding: 5px 8px; }
  .menu-grid .ui-icon { width: 23px; height: 23px; flex-basis: 23px; }
  dialog { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto auto 0; border-width: 1px 3px 0; border-radius: var(--r-sm); }
  #confirmation { width: 100%; max-width: 100%; }
  #confirmation-copy { padding: 12px 14px 4px; font-size: var(--text-base); }
  #confirmation > .panel-actions { padding: 10px 14px 14px; }
  .panel-head { padding: 7px 8px 7px 10px; gap: 6px; }
  .panel-kicker { display: none; }
  dialog h1 { font-size: var(--text-title); line-height: 1.4; }
  .panel-icon-btn { width: 40px; height: 40px; min-height: 40px; flex-basis: 40px; font-size: var(--text-title); }
  #panel-tabs { padding: 6px 8px; gap: 5px; }
  #panel-tabs button { min-height: 40px; padding: 4px 12px; font-size: var(--text-sm); }
  #panel-content { padding: 10px; }
  #panel-feedback { padding: 7px 10px; font-size: var(--text-sm); }
  #panel-recovery { padding: 0 10px 10px; }
  .catalog-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: end; padding: 7px 8px; }
  .catalog-field { font-size: var(--text-sm); gap: 2px; }
  .catalog-field--search { grid-column: 1 / -1; order: -1; }
  .catalog-label { display: none; }
  .catalog-field select { min-height: 36px; width: 100%; }
  #catalog-search { width: 100%; }
  .ui-hero { padding: 10px; gap: 10px; border-radius: var(--r-sm); }
  .ui-hero-art { flex-basis: 72px; width: 72px; height: 72px; }
  .hero-icon { width: 46px !important; height: 46px !important; }
  .ui-hero-title { font-size: var(--text-title); }
  .ui-hero-sub { font-size: var(--text-sm); }
  .ui-hero-body { flex-basis: 160px; }
  .ui-hero-actions { flex: 1 1 100%; }
  .ui-hero-actions .action-button, .ui-hero-actions .plain-button { flex: 1 1 40%; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .stat { padding: 7px 8px; gap: 6px; }
  .stat-icon { width: 24px; height: 24px; flex-basis: 24px; }
  .stat-value { font-size: var(--text-base); }
  .stat-label, .stat-sub { font-size: var(--text-sm); }
  .items { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .item { padding: 8px; gap: 5px; border-radius: var(--r-sm); }
  .item-art { height: 86px; }
  .item-art img { width: 76px; height: 76px; }
  .item-art .ui-item-art { width: 70px; height: 70px; }
  .item h2, .item-name { font-size: var(--text-base); }
  .item p { font-size: var(--text-sm); }
  .item-line .tiny.muted { display: none; }
  .ui-price { white-space: nowrap; }
  .ui-block { margin: 0 0 24px; }
  .ui-block-head { padding: 8px 10px 6px; }
  .ui-block-title { font-size: var(--text-base); }
  .ui-block-body { padding: 9px 10px; gap: 8px; }
  .ui-row { padding: 8px 9px; gap: 8px; }
  .ui-row-art { flex-basis: 42px; width: 42px; height: 42px; }
  .ui-row-title { font-size: var(--text-base); }
  .ui-row-sub { font-size: var(--text-sm); }
  .ui-row-actions { flex: 1 1 100%; margin-left: 0; }
  .ui-row-actions .action-button, .ui-row-actions .plain-button { flex: 1 1 40%; }
  .row { padding: 9px 10px; }
  .resource-line { padding: 9px 0; }
  input, select { font-size: var(--text-title); min-height: 40px; }
  .build-settings-table th, .build-settings-table td { padding: 4px 3px; font-size: var(--text-sm); }
  .quota-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quota-table dd { font-size: var(--text-base); }
  .exchange-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .exchange-option { padding: 9px; }
  .exchange-option .preset-value { font-size: var(--text-title); }
}
@media (max-width: 400px) {
  .topbar { grid-template-columns: minmax(0, 1fr) minmax(150px, 45%); }
  .asset img { display: none; }
  .toolbar button { height: 58px; }
  .toolbar button img { width: 36px; height: 32px; }
  .toolbar .tool-name { font-size: var(--text-sm) !important; }
  .items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .topbar { grid-template-columns: minmax(160px, 200px) minmax(190px, 240px) minmax(0, 1fr); align-items: center; padding: 4px 8px 0; }
  .player { padding: 3px 8px; }
  .avatar { flex-basis: 38px; width: 38px; height: 38px; }
  .farm-brand { font-size: var(--text-base); }
  #account, #production-progress { display: none; }
  .hud-nav { grid-column: auto; flex-wrap: nowrap; justify-content: flex-end; gap: 4px; }
  /* 横屏高度紧张时导航改为纯图标：文字保留给读屏，悬停有 title，完整文字入口仍在
     底部农具和“我的农场”菜单里，不会因为横向滚动把后两项藏出屏幕。 */
  .hud-nav button { position: relative; min-height: 34px; padding: 3px 6px; gap: 0; font-size: var(--text-sm); }
  .hud-nav button > span:last-child {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .nav-emblem { width: 26px; height: 26px; flex-basis: 26px; border-radius: var(--r-sm); }
  .nav-emblem img { width: 21px; height: 21px; }
  .toolbar { display: flex; justify-content: safe center; overflow-x: auto; }
  .tool-group { display: flex; }
  .tool-sep { display: block; height: 40px; }
  .toolbar button { width: 58px; flex-basis: 58px; height: 56px; }
  .toolbar button img { width: 32px; height: 28px; }
  .toolbar .tool-name { font-size: var(--text-sm) !important; }
  .scene-notices { max-height: 26dvh; }
  .crop-info { left: auto; right: 6px; bottom: 6px; width: 300px; max-height: calc(100% - 12px); }
  dialog { width: min(860px, calc(100% - 16px)); max-height: calc(100dvh - 16px); border-radius: var(--r-sm); }
}

/* ---------- 12 动效 ---------- */
@keyframes harvest-feedback { from { filter: brightness(1.7) saturate(1.2); } to { filter: brightness(1); } }
@keyframes plot-ready { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12) drop-shadow(0 0 7px var(--sand1)); } }
@keyframes care-ring { from { box-shadow: none; } to { box-shadow: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes menu-in { from { opacity: 0; transform: none; } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .plot.reward .soil, .plot.ready-pulse .soil, .plot.watering::after, .plot.caring::after { animation: none; }
  dialog[open], .game-menu:popover-open { animation: none; }
  * { scroll-behavior: auto !important; }
}


/* 百川农场：面板内业务结构组件。
 * 商店、土地、生产、交付、记录各自保留业务布局，但共用主题令牌与状态语汇。 */

/* 土地与开垦 */
.land-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));  }
.land-tile {
  display: grid; gap: 3px;  text-align: center;
  border: 1px solid var(--sand7); border-radius: var(--r-sm); 
  box-shadow: none; transition: none;
}

.land-tile[aria-current="true"] { border-color: var(--leaf); box-shadow: none; }
.land-tile .land-swatch {  border-radius: var(--r-sm);  }
.land-tile b { font-size: var(--text-sm); font-weight: 800; color: var(--ink-faint); }
.land-tile strong { font-size: var(--text-sm); line-height: 1.25; }
.land-tile small { font-size: var(--text-sm); color: var(--ink-faint); }
.land-tile--empty .land-swatch { background: var(--sand6); }
.land-tile--busy .land-swatch { background: var(--grass7); }
.land-tile--ready .land-swatch { background: var(--amber5); }
.land-tile--locked { opacity: .55; }
.land-tile--locked .land-swatch, .land-tile--next .land-swatch { background: var(--sand6); box-shadow: none; }

.land-detail { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.land-detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.land-detail-head h3 { font-size: var(--text-title); }
.land-detail-head .ui-hero-chips { margin-left: auto; }
.land-detail-note { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); }
.upgrade-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 10px; border: 1px dashed var(--sand7); border-radius: var(--r-sm); background: var(--amber2); }
.upgrade-row .grow { flex: 1 1 190px; min-width: 0; }
.upgrade-row strong { display: block; font-size: var(--text-base); }
.upgrade-row small { display: block; color: var(--ink-faint); font-size: var(--text-sm); }
.upgrade-row .action-button, .upgrade-row .plain-button { flex: 0 0 auto; }
.expand-card { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--amber7); border-radius: var(--r-sm); background: var(--amber2); }
.expand-card h3 { font-size: var(--text-title); }
.expand-req { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* 田地清单 */
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 9px; }
.field-card { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.field-card--ready { border-color: var(--amber7); background: var(--sand2); }
.field-card--care { border-color: var(--grass7); }
.field-card--empty { background: var(--sand2); }
.field-head { display: flex; align-items: center; gap: 8px; }
.field-art { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--sand2); box-shadow: none; }
.field-art img { width: 100%; height: 100%; object-fit: contain; }
.field-body { min-width: 0; flex: 1; display: grid; gap: 1px; }
.field-body strong { font-size: var(--text-base); }
.field-body small { color: var(--ink-faint); font-size: var(--text-sm); }
.field-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.field-actions .action-button, .field-actions .plain-button { flex: 1 1 42%; min-height: 36px; padding: 6px 10px; font-size: var(--text-base); }

/* 生产设施：配方、队列、材料 */
.recipe-grid { display: grid;   }
.recipe-card { display: grid;      }
.recipe-head { display: flex; align-items: center;  }
.recipe-icon {   flex: 0 0 44px; display: grid; place-items: center; border-radius: var(--r-sm);   }

.recipe-icon img { width: 100%; height: 100%; object-fit: contain; filter: none; }
.recipe-title { min-width: 0; flex: 1; display: grid; line-height: 1.25; }

.recipe-title small { color: var(--ink-faint); font-size: var(--text-sm); }
.recipe-flow { display: flex; align-items: center;  flex-wrap: wrap;  border-radius: var(--r-sm);   }
.recipe-flow .flow-arrow { color: var(--sand9); font-weight: 800; }
.recipe-actions { display: flex; align-items: center;  flex-wrap: wrap; }
.recipe-actions .action-button { flex: 1 1 auto; }
.recipe-actions .ui-stepper { margin-left: auto; }

.queue-item { display: grid; gap: 6px;     }

.queue-top { display: flex; align-items: center;  flex-wrap: wrap; }
.queue-top strong { font-size: var(--text-base); }
.queue-top .chip { margin-left: auto; }
.queue-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.queue-item > .plain-button, .queue-item > .action-button { justify-self: start; }
.queue-actions .action-button, .queue-actions .plain-button { flex: 0 1 auto; min-height: 36px; padding: 6px 12px; font-size: var(--text-base); }
.material-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 9px; }
.material-card { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.material-head { display: flex; align-items: center; gap: 8px; }
.material-art {   flex: 0 0 46px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--sand2); box-shadow: none; }
.material-art .ui-item-art { width: 80%; height: 80%; }
.material-head .material-name { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.material-head .material-name strong { font-size: var(--text-base); }
.material-head .material-name small { color: var(--ink-faint); font-size: var(--text-sm); }
.material-card p { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); }
.material-card .material-sell { display: flex; align-items: center;  flex-wrap: wrap; }
.material-card .material-sell .action-button { flex: 1 1 auto; min-height: 36px; padding: 6px 10px; font-size: var(--text-base); }

/* 委托与合同 */
.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));  }
.order-card { display: grid;      }

.order-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.order-head .chip { margin-left: auto; }
.demand-list { display: grid; gap: 4px; }
.demand { display: flex; align-items: center;      }
.demand-art { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; }
.demand-art img, .demand-art .ui-item-art { width: 100%; height: 100%; object-fit: contain; }
.demand--lack { background: var(--sand3);  }
.demand .demand-count { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 800; }
.reward-row { display: flex; align-items: center;  flex-wrap: wrap; }

.order-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.order-actions .action-button, .order-actions .plain-button { flex: 1 1 42%;  padding: 6px 10px; font-size: var(--text-base); }

/* 签到与成就 */
.checkin-strip { display: grid;   }
.checkin-day { display: grid;  justify-items: center;   border-radius: var(--r-sm);   color: var(--ink-faint); }
.checkin-day strong { font-size: var(--text-base); color: var(--ink); }
.checkin-day--today {   box-shadow: none; }

.achv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 8px; }
.achv-card { display: grid; gap: 5px; padding: 9px 10px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.achv-card--done { border-color: var(--grass7); background: var(--grass2); }
.achv-card--claimed { opacity: .72; }
.achv-card strong { font-size: var(--text-base); }
.achv-card small { color: var(--ink-faint); font-size: var(--text-sm); }
.achv-card .ui-progress { margin: 1px 0; }

/* 钻石与兑换 */
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.route-card { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.route-card .route-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--sand2); box-shadow: none; }
.route-card .route-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.route-card strong { font-size: var(--text-base); }
.route-card small { color: var(--ink-faint); font-size: var(--text-sm); line-height: 1.45; }
.relay-reqs { display: grid; gap: 7px; }
.req-row { display: flex; align-items: center; gap: 8px; }
.req-row .ui-progress { flex: 1; min-width: 0; }
.req-row .req-label { flex: 0 0 84px; font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft); }
.quota-hero { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.preset-flow { display: flex; align-items: center;  font-weight: 800;  }

.exchange-note { margin: 0; font-size: var(--text-sm); color: var(--ink-faint); }

/* 经营指引 */
.guide-steps { display: grid; gap: 9px; }
.guide-step { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.guide-step-index { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; color: var(--amber2); font-weight: 800; background: var(--grass8); box-shadow: none; }
.guide-step-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.guide-step-body strong { font-size: var(--text-base); }
.guide-step-body p { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); }
.guide-step-body .guide-links { display: flex; gap: 6px; flex-wrap: wrap; }
.guide-step-body .guide-links .plain-button { min-height: 34px; padding: 5px 11px; font-size: var(--text-sm); }

/* 装扮 / 守护犬 */
.decor-grid { display: grid;   }
.decor-card { display: grid; gap: 6px; padding: 9px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.decor-preview {  display: grid; place-items: center;    overflow: hidden; }

.decor-preview .guard-kennel-art { width: 66px; height: 66px; }
.decor-card strong { font-size: var(--text-base); }
.decor-card small { color: var(--ink-faint); font-size: var(--text-sm); }
.decor-card .decor-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.decor-card .decor-actions .action-button, .decor-card .decor-actions .plain-button { flex: 1 1 42%; min-height: 34px; padding: 5px 9px; font-size: var(--text-sm); }
.decor-card .decor-actions select { flex: 1 1 100%; min-height: 36px; font-size: var(--text-sm); }
.decor-card .decor-actions select.has-value { border-color: var(--grass8); background: var(--grass2); }
.decor-status { display: flex; flex-wrap: wrap; gap: 4px; }

.decor-preview > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.guard-loadout-copy { margin: 0; font-size: var(--text-sm); line-height: 1.5; color: var(--ink-soft); }
.decor-note { margin: 0; line-height: 1.45; }

.guard-dog .guard-thumb-loadout { position: absolute; left: 2px; bottom: 1px; display: flex; gap: 1px; }
.guard-dog .guard-thumb-loadout img { position: static; width: 16px; height: 16px; object-fit: contain; }

/* 手札与图鉴 */
.journal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 7px; }
.journal-tile { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.journal-art { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--sand2); box-shadow: none; overflow: hidden; }
.journal-art img, .journal-art .ui-item-art { width: 100%; height: 100%; object-fit: contain; }
.journal-body { min-width: 0; display: grid; gap: 1px; }
.journal-tile strong { font-size: var(--text-sm); }
.journal-tile small { color: var(--ink-faint); font-size: var(--text-sm); }

/* 邻居 */
.neighbor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 10px; }
.neighbor-card { display: grid; gap: 7px; padding: 11px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.neighbor-head { display: flex; align-items: center; gap: 9px; }
.neighbor-avatar { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; color: var(--amber2); font-weight: 800; font-size: var(--text-title); background: var(--grass8); box-shadow: none; }
.neighbor-head .neighbor-name { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.neighbor-head .neighbor-name strong { font-size: var(--text-base); }
.neighbor-head .neighbor-name small { color: var(--ink-faint); font-size: var(--text-sm); }
.neighbor-plots { display: grid; gap: 4px; }
.neighbor-plot { display: flex; align-items: center; gap: 6px; padding: 4px 7px; border-radius: var(--r-sm); background: var(--amber2); font-size: var(--text-sm); }
.neighbor-plot .demand-count { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.neighbor-plots .action-button { min-height: 32px; padding: 4px 10px; font-size: var(--text-sm); }

/* 记录与提示 */
.timeline { display: grid; gap: 6px; }
.timeline-item { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--sand7); border-radius: var(--r-sm); background: var(--sand2); }
.timeline-item .timeline-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: var(--r-sm);  }
.timeline-item .timeline-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.timeline-item time { color: var(--ink-faint); font-size: var(--text-sm); }
.timeline-item strong { font-size: var(--text-base); }
.timeline-item p { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.5; overflow-wrap: anywhere; }
.hint-card { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px;    font-size: var(--text-sm);  }
.hint-card .ui-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.hint-card strong { color: var(--wood-dark); }
.hint-card--danger { border-color: var(--sand7);   }
.rules-note { margin-top: 4px; }
.rules-note > summary { font-size: var(--text-base); }
.rules-note p { font-size: var(--text-sm); }

/* 建筑显示 */
.build-settings { display: grid; gap: 10px; }
.build-settings-actions {
  position: sticky; top: -16px; z-index: 3; margin: 0 -2px; padding: 8px 10px;
    
  
}
.build-settings-actions .panel-note { margin: 0 0 0 auto; font-size: var(--text-sm); }
.build-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 9px; }
.build-settings-grid .ui-section-title { grid-column: 1 / -1; margin-top: 4px; }
.build-card {
  display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px 10px; align-items: center;
  padding: 9px; border: 1px solid var(--sand7); border-radius: var(--r-sm);
  background: var(--sand2);
}
.build-card.is-off { opacity: .6; background: var(--sand3); }
.build-preview { width: 74px; height: 74px; grid-row: span 2; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--sand2); box-shadow: none; overflow: hidden; }
.build-preview img { width: 100%; height: 100%; object-fit: contain; }
.build-preview-icon { width: 40px !important; height: 40px !important; }
.build-info { display: grid; gap: 1px; min-width: 0; }
.build-info strong { font-size: var(--text-base); }
.build-info small { color: var(--ink-faint); font-size: var(--text-sm); }
.build-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; grid-column: 2; }
.build-toggle { display: flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--ink-soft); cursor: pointer; min-height: 34px; }
.build-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.build-toggle-track { position: relative; width: 34px; height: 20px; flex: 0 0 34px; border-radius: 999px; background: var(--sand8); box-shadow: none; transition: none; }
.build-toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--sand2); box-shadow: none; transition: none; }
.build-toggle input:checked + .build-toggle-track { background: var(--grass8); }
.build-toggle input:checked + .build-toggle-track::after { transform: translateX(14px); }
.build-toggle input:focus-visible + .build-toggle-track { outline: 3px solid var(--sky11); outline-offset: 2px; }

/* 提示卡与引用 */
.hint-card .hint-body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.hint-card .hint-body p { margin: 0; font-size: var(--text-sm); line-height: 1.5; }
.hint-card > .action-button, .hint-card > .plain-button { margin-left: auto; flex: 0 0 auto; }
.item-quote {   min-height: 18px; }
.item-quote.is-danger { color: var(--danger) !important; font-weight: 700; }
.crop-identity { min-width: 0; display: grid; line-height: 1.2; flex: 1; }
.crop-identity strong { font-size: var(--text-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crop-identity small { color: var(--ink-faint); font-size: var(--text-sm); }
.crop-info .ui-hero-chips { gap: 4px; }
.crop-info .ui-progress { width: 100%; }
.crop-info .crop-body { gap: 9px; }
.crop-info .crop-actions .ghost-button { flex: 1 1 100%; }
.build-settings .ui-section-title { color: var(--wood-dark); }

/* 提示区与空态补充 */
.hint-card + .hint-card { margin-top: 8px; }
.ui-block .ui-empty { padding: 12px 10px; }
.ui-block-body > .ui-stepper { justify-self: start; }
.ui-empty-copy { text-wrap: pretty; }
.ui-block .ui-empty-art { width: min(180px, 60%); }

@media (max-width: 720px) {
  .build-settings-grid { grid-template-columns: 1fr; }
  .build-card { grid-template-columns: 60px minmax(0, 1fr); }
  .build-preview { width: 60px; height: 60px; }
  .build-toggles { grid-column: 2; gap: 4px; }
  .build-toggle { font-size: var(--text-sm); }
  .build-settings-actions { top: -10px; padding: 6px 8px; }
}

.split { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.muted { color: var(--ink-faint); }
.tiny { font-size: var(--text-sm); }
.mono { font-variant-numeric: tabular-nums; }
.inline-icons { display: inline-flex; gap: 4px; align-items: center; }
.panel-lead { display: grid; gap: 6px; margin: 0 0 12px; padding: 10px 12px; border-left: 1px solid var(--leaf-2); border-radius: var(--r-sm); background: var(--amber2); font-size: var(--text-base); color: var(--ink-soft); }
.panel-lead strong { color: var(--wood-dark); }
.panel-lead p { margin: 0; }

@media (max-width: 720px) {
  .land-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
  .land-tile { padding: 5px 4px; border-radius: var(--r-sm); }
  .land-tile .land-swatch { height: 18px; }
  .land-tile strong { font-size: var(--text-sm); }
  .land-tile small { font-size: var(--text-sm); }
  .land-tile b { font-size: var(--text-sm); }
  .land-detail { padding: 9px; }
  .upgrade-row { padding: 7px 8px; }
  .field-grid { grid-template-columns: 1fr; }
  .recipe-grid, .order-grid, .neighbor-grid, .material-grid { grid-template-columns: 1fr; }
  .checkin-strip { gap: 4px; }
  .checkin-day { padding: 5px 1px; font-size: var(--text-sm); }
  .checkin-day strong { font-size: var(--text-sm); }
  .achv-grid, .decor-grid, .journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-grid { grid-template-columns: 1fr; }
  .guide-step { padding: 8px 9px; }
  .guide-step-body .guide-links .plain-button { flex: 1 1 40%; }
  .exchange-presets .exchange-option .action-button { font-size: var(--text-base); }
  .decor-preview { height: 66px; }
  .decor-preview svg { width: 46px; height: 46px; }
  .dog-card { grid-column: 1 / -1; }
  .panel-lead { padding: 8px 10px; font-size: var(--text-sm); }
}
@media (max-width: 400px) {
  .achv-grid, .decor-grid, .journal-grid, .route-grid { grid-template-columns: 1fr; }
}

/* Honey oak, cream paper and fruit-bright controls; no continuous UI animation. */
body { font-size: var(--text-base); background-color: var(--grass3); }
.items, .recipe-grid, .order-grid { contain: style; }
.ui-icon svg *, .ui-item-art svg *, .ui-empty-art svg * { vector-effect: non-scaling-stroke; }
h1, .farm-brand, .menu-title { font-family: "FarmTitle", "Microsoft YaHei", "PingFang SC", sans-serif; letter-spacing: 0; }
button, input, select, textarea { font-size: var(--text-base); }
.action-button, .plain-button, .ghost-button { min-height: 44px; padding: 10px 14px; font-size: var(--text-base); font-weight: 700; }
.action-button { background: var(--button-fill); color: var(--game-white); border: 1.5px solid #398b19; border-radius: 12px; text-shadow: 0 1px 1px #28630e; box-shadow: var(--button-shadow); }
.action-button:hover:not(:disabled) { background: linear-gradient(#a0e96a, #77d647 12%, #53b62b); color: var(--game-white); filter: none; }
.action-gold, [data-route=lands] .action-button { background: var(--gold-fill); border-color: #c88929; color: #61360f; text-shadow: 0 1px 0 #ffefa9; box-shadow: var(--gold-shadow); }
.action-gold:hover:not(:disabled), [data-route=lands] .action-button:hover:not(:disabled) { background: linear-gradient(#fff0b2, #ffd363 15%, #ffb83e); color: #61360f; }
.action-button:active:not(:disabled), .plain-button:active:not(:disabled), .panel-icon-btn:active { transform: translateY(2px); box-shadow: inset 0 1px 3px #3f2c1c33; }
.plain-button { border: 1px solid #b18a51; background: var(--control-fill); color: var(--wood-dark); box-shadow: var(--control-shadow); }
.plain-button:hover:not(:disabled) { border-color: var(--wood); background: linear-gradient(#f9efcf, #eddaab); }
.ghost-button { border: 1px dashed var(--sand8); background: #ead9b64d; color: var(--ink-soft); }
.danger-button { background: linear-gradient(#cb6a45, #a64930); border-color: #7b3420; color: var(--game-white); text-shadow: 0 1px 1px #762c1c; box-shadow: inset 0 1px 0 #efb18a, 0 3px 0 #793821; }
.danger-button:hover:not(:disabled) { background: linear-gradient(#d37c54, #af4e32); }
.action-button:disabled, .plain-button:disabled, .ghost-button:disabled { background: var(--sand3); border-color: var(--sand7); color: var(--ink-soft); opacity: 1; box-shadow: inset 0 1px 2px #6f52351a; text-shadow: none; }
input, select, textarea { border: 1px solid var(--sand8); background: var(--paper); border-radius: var(--r-sm); box-shadow: inset 0 2px 3px #78522814, 0 1px 0 #fcf1d5; min-height: 44px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, #viewport:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 3px; }
.ui-stepper { display: inline-grid; grid-template-columns: 44px minmax(36px, 1fr) 44px; flex: 0 0 auto; width: 138px; min-width: 126px; overflow: visible; border: 1px solid var(--sand7); border-radius: 12px; background: var(--paper); box-shadow: inset 0 2px 3px #7852280c; }
.ui-stepper--max { grid-template-columns: 44px minmax(36px, 1fr) 44px 44px; width: 174px; min-width: 170px; }
.ui-stepper button { width: 100%; min-width: 0; min-height: 44px; padding: 0; background: var(--control-fill); font-size: var(--text-title); color: var(--wood-dark); box-shadow: inset 0 1px 0 #fff; }
.ui-stepper .stepper-btn { width: 100%; height: 44px; min-height: 44px; }
.ui-stepper button:first-child { border-radius: 11px 0 0 11px; }
.ui-stepper button:last-child { border-radius: 0 11px 11px 0; }
.ui-stepper .stepper-max { height: 44px; font-size: var(--text-sm); font-weight: 800; border-left: 1px solid var(--sand6); color: #51762a; }
.ui-stepper button:disabled { background: var(--sand3); color: var(--sand10); opacity: 1; }
.ui-stepper .stepper-input { min-width: 0; width: 100%; height: 44px; border: 0; border-radius: 0; padding: 0 2px; font-size: var(--text-base); box-shadow: none; background: var(--paper); appearance: textfield; }
.chip { border: 1px solid var(--sand6); border-radius: 999px; padding: 2px 7px; font-size: var(--text-sm); font-weight: 600; background: var(--amber1); color: var(--ink-soft); box-shadow: inset 0 1px 0 #fcf1d5; }
.chip--leaf { background: var(--grass3); color: var(--grass11); }
.chip--gold { background: var(--amber3); color: var(--amber12); }
.chip--gem, .chip--info { background: var(--sky3); color: var(--sky12); }
.chip--danger { background: var(--tomato3); color: var(--tomato11); }
.chip--muted { background: var(--sand3); color: var(--sand11); }
.ui-segmented { background: var(--sand3); border: 1px solid var(--sand6); border-radius: 999px; box-shadow: inset 0 1px 3px #78522826; }
.ui-segment { min-height: 44px; border-radius: 999px; }
.ui-segment[aria-current="true"] { background: var(--button-fill); color: var(--game-white); box-shadow: inset 0 1px 0 #cde79088, 0 2px 0 #486626; }
.ui-switch-track, .build-toggle-track { box-shadow: inset 0 1px 3px #55331644; }
.ui-switch-track::after, .build-toggle-track::after { background: var(--control-fill); box-shadow: 0 1px 2px #55331655; }
.ui-price { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--sand12); font-size: var(--text-base); }
.ui-price strong, .stat-value, .asset strong, .demand-count, .item-count { font-variant-numeric: tabular-nums; }
.topbar { padding: 14px 20px 0; gap: 16px; grid-template-columns: 226px 284px minmax(0, 1fr); align-items: start; }
.player { position: relative; min-height: 62px; margin-left: 20px; padding: 5px 12px 5px 44px; border: 2px solid #ce9b59; background: #fffdf7f5; border-radius: 32px; box-shadow: inset 0 1px 0 #fff, 0 3px 0 #8f60242e; }
.farm-brand { color: #74451f; font-size: 17px; font-weight: 800; }
.level-chip { color: #fff; background: linear-gradient(#91d74e, #61a62c); border: 1px solid #62952b; font-size: 11px; padding-inline: 6px; text-shadow: 0 1px #45721f; }
.player-info { gap: 2px; }
.player-info strong { font-size: var(--text-sm); color: var(--ink-soft); }
.player-info progress { height: 5px; margin: 1px 0; }
#account, .asset small { display: none; }
#production-copy { font-size: 11px; color: #62441e; }
.wallet { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; gap: 5px 8px; grid-template-columns: 1.5fr 1fr; }
.asset { min-height: 40px; gap: 4px; padding: 3px 9px 3px 4px; border: 2px solid #dbb66e; border-radius: 24px; background: linear-gradient(#fffef8, #fff1cd); box-shadow: inset 0 1px #fff, 0 2px 0 #9d70302e; }
.asset strong { font-size: 19px; color: #67411c; }
.asset--gem { border-color: #9dcee3; background: linear-gradient(#f9feff, #e0f5fc); }
.asset--gem .asset-text strong { color: #197b9c; }
.asset img { display: block; width: 30px; height: 30px; flex-basis: 30px; }
.asset-go { width: 12px; height: 12px; flex-basis: 12px; }
.meter-pill { min-height: 20px; padding: 1px 8px; border: 1px solid #d8c79b; background: #fffdf7e8; box-shadow: none; gap: 5px; }
.meter-icon { width: 16px; height: 16px; flex-basis: 16px; }
.meter-body { display: flex; align-items: center; gap: 6px; }
.meter-track { width: 36px; height: 4px; flex: 0 0 36px; }
.avatar { position: absolute; left: -22px; top: -3px; width: 64px; height: 64px; padding: 4px; border: 3px solid #f4cc76; border-radius: 50%; background: var(--amber2); box-shadow: inset 0 0 0 1px #b47c38, 0 3px 0 #8c592b40; }
.avatar img { border-radius: 50%; }
.hud-nav { flex-wrap: nowrap; gap: 10px; overflow: visible; }
.hud-nav button { flex: 0 0 60px; flex-direction: column; gap: 3px; width: 60px; min-height: 68px; padding: 0; background: none; border: 0; border-radius: 16px; color: #633e1d; font-size: var(--text-sm); text-shadow: 0 1px 0 #fff6d8; box-shadow: none; }
.hud-nav button:hover { background: none; filter: none; }
.nav-emblem { width: 46px; height: 46px; flex-basis: 46px; border: 2px solid #d39b53; border-radius: 16px; background: linear-gradient(#fff5ca, #f0cd83); box-shadow: inset 0 2px #fff8df, 0 3px 0 #b07a38; }
.nav-emblem img { width: 39px; height: 39px; }
.hud-nav button:first-child .nav-emblem { background: linear-gradient(#ffe2a5, #ffc16b); border-color: #d39443; }
.hud-nav button:nth-child(3) .nav-emblem { background: linear-gradient(#e6f5bd, #b8da78); border-color: #94b859; }
.hud-nav button:nth-child(5) .nav-emblem { background: linear-gradient(#e9fbff, #a9e1f3); border-color: #7ab8d2; box-shadow: inset 0 2px #fff, 0 3px 0 #629db7; }
.hud-nav button:hover .nav-emblem { transform: translateY(-2px); }
.viewport { top: 0; bottom: 0; }
.toolbar { left: 50%; right: auto; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); gap: 0; padding: 6px 12px 8px; overflow: visible; background: var(--wood-grain), linear-gradient(#f0c67c, #d7a45d 18%, #bd823e); border: 3px solid #8f572b; border-radius: 28px; box-shadow: inset 0 2px 0 #ffe8b4, inset 0 -2px 0 #a86e34, 0 4px 0 #75451f, 0 8px 14px #4d381f33; }
.toolbar::before, .toolbar::after { display: none; }
.toolbar .tool-name { color: #fffdf4 !important; font-size: var(--text-sm) !important; text-shadow: 0 1px 1px #694019; }
.toolbar button { flex-basis: 62px; width: 62px; height: 66px; padding: 0 2px 3px; border: 1px solid transparent; border-radius: 20px; }
.toolbar button img { width: 46px; height: 44px; margin-top: -6px; }
.toolbar button:hover { background: #fff0b842; }
.toolbar button[aria-pressed=true] { background: linear-gradient(#fff0a9cc, #fbd45e99); border-color: #ffeaa0; box-shadow: inset 0 1px 0 #fff6c7, 0 2px 5px #a1652855; transform: translateY(-4px); }
.toolbar button[aria-pressed=true] .tool-name { color: #72471a !important; text-shadow: 0 1px #fff2b9; }
.tool-sep { background: linear-gradient(transparent, #fff1c8a3, transparent); box-shadow: 1px 0 0 #9b622e55; width: 1px; height: 40px; margin-inline: 6px; }
.scene-controls { bottom: calc(var(--tools-height) + 30px); border: 1px solid #ccaa6b; background: #fffdf7eb; border-radius: 16px; box-shadow: 0 3px 8px #5e3b2024; backdrop-filter: none; }
.scene-btn { background: var(--control-fill); border: 1px solid var(--sand6); min-height: 44px; color: var(--wood-dark); box-shadow: inset 0 1px 0 #fcf1d5; }
.scene-btn:hover { background: var(--amber2); }
.scene-zoom-label { color: var(--sand11); }
.task-strip { background: transparent; border: 0; box-shadow: none; }
.task-chip { border: 1px solid var(--wood-light); background: var(--paper); color: var(--wood-dark); min-height: 40px; box-shadow: var(--card-shadow); }
.task-chip--ready { background: var(--amber3); color: var(--amber12); }
.status, .operation-status, .visit-banner, .crop-info { border: 1.5px solid var(--wood-light); background: var(--paper) var(--grain); background-size: 6px 6px; box-shadow: var(--lift); }
.status.error, .operation-status[data-phase=offline] { color: var(--tomato11); background: var(--tomato2); border-color: var(--tomato7); }
.crop-info header { background: var(--paper-2); border-bottom: 1px solid var(--sand6); }
.building-name { background: #654724a8; color: #fffdf1; border: 1px solid #f0d69a66; padding: 1px 7px; border-radius: 8px; font: 600 11px/1.65 "Microsoft YaHei", sans-serif; text-shadow: 0 1px 1px #503516; box-shadow: none; }
.building::before { display: none; }
.building-affordance { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; padding: 3px; border: 1px solid #c7935099; border-radius: 50%; background: #553316e6; color: var(--game-white); }
.building-affordance svg { stroke: var(--game-white); }
.building-affordance { display: none; }
.building:hover .building-affordance, .building:focus-visible .building-affordance { opacity: 1; }
.building-name { transform: translateX(-50%) scale(var(--scene-ui-scale, 1)); transform-origin: center top; }
@media (hover: none) { .building-affordance { opacity: 1; } }
/* A terrain hit target follows the soil silhouette. Crops remain uncut. */
.plot { pointer-events: none; }
.plot-hit { position: absolute; inset: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); pointer-events: auto; }
.plot.locked:not(.plot-next) .plot-hit { pointer-events: none; }
.plot .crop { pointer-events: auto; }
#plots { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
#buildings { position: absolute; inset: 0; z-index: 11; pointer-events: none; }
#buildings .building:not(.scenery) { pointer-events: auto; }
#building-dog { z-index: 12; }
#owned-props { position: absolute; inset: 0; z-index: auto; pointer-events: none; }
.owned-prop[data-landscape-layer="landscape"] { z-index: 12 !important; }
.owned-prop-tooltip { transform-origin: center bottom; }
#theme-art .theme-art-native { position: absolute; display: block; object-fit: contain; pointer-events: none; }
#scene-markers { position: absolute; inset: 0; z-index: 13; pointer-events: none; }
.plot-badge { position: absolute; display: inline-flex; align-items: center; gap: 3px; transform: translate(-50%, -100%) scale(var(--scene-ui-scale, 1)); transform-origin: center bottom; padding: 2px 7px; border: 1px solid var(--wood-light); border-radius: 999px; background: #553316eb; color: var(--game-white); font-size: var(--text-sm); font-weight: 700; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 3px #3f2c1c33; }
.plot-badge--ready { border-color: var(--amber8); background: var(--amber3); color: var(--amber12); }
.plot-badge--care { border-color: #8ac9dc; background: #f2fdff; color: #256e84; }
.plot-badge--hazard { border-color: var(--tomato8); background: var(--tomato3); color: var(--tomato12); }
.plot-badge--wither { border-color: var(--sand8); background: var(--sand3); color: var(--sand12); }
.plot-expand { position: absolute; transform: translate(-50%, -50%) scale(var(--scene-ui-scale, 1)); display: grid; grid-template-columns: 20px 1fr; align-content: center; align-items: center; column-gap: 5px; row-gap: 0; width: 106px; height: 52px; padding: 6px 5px 3px; border: 2px solid #95602a; border-radius: 11px; background: repeating-linear-gradient(112deg, transparent 0 12px, #fff3c21c 12px 14px, transparent 14px 27px), linear-gradient(#e5b566, #ca9147 40%, #ae7335); color: var(--game-white); font-size: 11px; font-weight: 600; text-shadow: 0 1px 1px #684015; cursor: pointer; pointer-events: auto; touch-action: manipulation; box-shadow: inset 0 2px 0 #ffe2a0, inset 0 -2px 0 #95602b, 0 3px 0 #70451f, 0 5px 7px #3f2c1c33; }
.plot-expand[data-state=ready]::after { content: '可开垦'; position: absolute; right: -4px; top: -10px; padding: 0 5px; border: 1px solid #d39a28; border-radius: 6px; background: #ffe47b; color: #72430f; font-size: 10px; line-height: 17px; text-shadow: none; box-shadow: 0 1px 0 #b37a25; }
.plot-expand strong { font-size: var(--text-base); line-height: 1.4; grid-column: 2; }
.plot-expand > * { pointer-events: none; }
.plot-expand-icon { grid-row: span 2; width: 20px; height: 28px; object-fit: contain; filter: drop-shadow(0 1px 1px #3f2c1c55); }
.plot-expand > span { white-space: nowrap; }
.plot-expand[data-state=locked] { background: var(--wood-grain), linear-gradient(#977345, #73532e); border-color: var(--wood-dark); color: var(--game-white); }
.plot-expand:hover { background: var(--wood-grain), linear-gradient(#f2c878, #cc9244); }
.plot.inspected .soil { filter: brightness(1.12); }
.plot.inspected { outline: 0; }
.plot:focus-visible .plot-hit { background: var(--skyA6); }
.plot-bar { background: var(--sandA8); box-shadow: none; }
.plot-bar > span { background: var(--grass9); }
.plot.reward .soil { animation: harvest-feedback 250ms ease-out; }
.plot.watering::after, .plot.caring::after { animation: none; }
dialog { width: min(1080px, calc(100% - 40px)); border: 2px solid #b78143; border-radius: 24px; background: var(--paper); box-shadow: inset 0 0 0 1px #ffe6ad, 0 16px 40px #38341d59; }
dialog::backdrop { background: #24371c66; backdrop-filter: none; }
.panel-head, .menu-head { padding: 12px 20px; background: var(--wood-grain), var(--wood-fill); color: var(--game-white); border-bottom: 2px solid #b47b39; border-radius: 0; box-shadow: inset 0 2px 0 #ffe2a0; }
.panel-head h1, .menu-title { color: #fffdf5; font-size: 22px; font-weight: 800; text-shadow: 0 2px 1px #9f682d; }
.panel-kicker, .ui-hero-kicker { display: none; }
.panel-icon-btn, .menu-close, .small-close { display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; flex: 0 0 44px; padding: 0; border: 2px solid #b4803f; border-radius: 50%; background: linear-gradient(#fff9df, #f7d793); color: #75451f; font-size: var(--text-display); box-shadow: inset 0 0 0 2px #fff0c4, 0 2px 0 #9d672d; }
#panel-tabs { margin-inline: 8px; padding: 10px 14px 12px; gap: 8px; background: var(--paper); border-bottom: 1px solid var(--sand6); scroll-padding-inline: 20px; scrollbar-width: none; mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent); }
#panel-tabs button { min-height: 44px; border: 1px solid var(--sand7); background: var(--control-fill); border-radius: 999px; color: var(--wood-dark); box-shadow: var(--control-shadow); }
#panel-tabs button[aria-current=page] { background: var(--button-fill); color: var(--game-white); border-color: var(--leaf-dark); text-shadow: 0 1px 1px #294315; box-shadow: var(--button-shadow); }
#panel-content { padding: 20px; background: var(--paper); scroll-padding-top: 20px; scrollbar-gutter: stable; }
.catalog-controls { flex: 0 0 auto; position: relative; z-index: 1; padding: 10px 20px 12px; background: var(--paper); border-bottom: 1px solid var(--sand6); box-shadow: 0 3px 0 #f4e8ce; }
.catalog-field { gap: 6px; }
.panel-toolbar { gap: 8px; margin-bottom: 16px; }
.pagination { justify-content: flex-end; margin: 0 0 16px; }
.items { grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }
.item { padding: 12px; gap: 8px; border: 1px solid #e2c797; border-radius: 16px; background: linear-gradient(#fffaf0, #f5ebd6); box-shadow: var(--card-shadow); }
.item-art { height: 120px; border: 1px solid #ebd4aa; background: radial-gradient(ellipse at 50% 35%, #fffefa, #f4e5c3); box-shadow: inset 0 2px 3px #c79c4d12; border-radius: 12px; }
.item-art img { width: 112px; height: 112px; filter: drop-shadow(0 3px 3px #78522824); }
.item-art .ui-item-art { width: 100px; height: 100px; }
.item-name, .item h2 { font-size: var(--text-title); }
.item .item-meta { gap: 4px; }
.item-meta .chip { padding: 1px 6px; background: var(--amber1); color: var(--ink-soft); }
.item-meta .chip + .chip { margin-left: 0; }
.item-flag { left: 8px; top: 8px; }
.item .item-line { flex-wrap: wrap; }
.item .item-line .tiny { margin-left: auto; }
.item .action-button, .item .plain-button { min-height: 44px; }
.item p { font-size: var(--text-sm); line-height: 1.65; }
.item-quote { font-size: var(--text-sm) !important; color: var(--sand11) !important; }
.catalog-item > .item-name { padding-right: 0; }
.item-stock { align-items: center; justify-content: space-between; }
.item-stock .ui-price { white-space: nowrap; }
.item .item-lock { position: absolute; right: 5px; top: 5px; display: grid; place-items: center; width: 44px; height: 44px; padding: 9px; border: 1px solid #ddc18d; border-radius: 50%; background: #fffdf7eb; color: #987343; box-shadow: inset 0 1px #fff, 0 2px 3px #99723b18; }
.item-lock .ui-icon { width: 24px; height: 24px; }
.item-lock[aria-pressed=true] { background: #ffdf83; border-color: #cb972c; box-shadow: inset 0 1px #fff1b3, 0 2px 0 #c59a46; }
.item-lock[aria-pressed=false] .ui-icon { opacity: .6; }
.catalog-item.item-locked::after { display: none; }
.trade-quote { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-height: 30px; padding: 5px 0; border-top: 1px solid #e5d2ad; }
.trade-quote .ui-price { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 999px; background: #fff3cc; color: #875216; font-size: 19px; line-height: 1.3; }
.trade-quote .price-icon { width: 23px; height: 23px; }
.quote-label, .quote-detail { font-size: var(--text-sm); color: #7b6039; }
.quote-detail { margin-left: auto; }
.quote-message { color: #a43f24; line-height: 1.5; }
.trade-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin-top: auto; min-width: 0; }
.trade-actions > .ui-stepper { flex: 0 0 174px; width: 174px; margin: 0; }
.trade-actions > .action-button, .trade-actions > .plain-button { flex: 1 1 auto; width: auto; min-width: 0; padding: 9px 6px; font-size: var(--text-sm); white-space: nowrap; }
.catalog-item > details { font-size: var(--text-sm); color: #8a6a3d; }
.catalog-item > details > summary { min-height: 28px; padding: 4px 0; cursor: pointer; }
/* Defer offscreen warehouse layout without discarding live controls or drafts. */
[data-route=warehouse] .catalog-item { content-visibility: auto; contain-intrinsic-block-size: auto 270px; }
[data-route=warehouse] > .stat-grid { display: flex; gap: 8px; margin-bottom: 12px; }
[data-route=warehouse] > .stat-grid .stat { flex: 1; padding: 7px 10px; gap: 6px; }
[data-route=warehouse] > .stat-grid .stat-sub { display: none; }
[data-route=warehouse] > .stat-grid .stat-value { font-size: var(--text-title); }
[data-route=warehouse] > .stat-grid .stat-icon { width: 26px; height: 26px; flex-basis: 26px; }
.item-selected { border-color: var(--grass9); }
.item-locked { background: var(--sand3); }
.item-selected::before, .item-locked::after { border-radius: 999px; background: var(--grass3); color: var(--grass12); font-size: var(--text-sm); }
.ui-hero-art { width: 88px; height: 88px; flex-basis: 88px; }
.ui-hero-art--icon { background: var(--grass3); }
.ui-hero-sub { max-width: 64ch; font-size: var(--text-base); }
.ui-hero-body { gap: 8px; min-width: 0; }
.ui-hero-chips { min-width: 0; }
.ui-hero-chips .chip { max-width: 100%; white-space: normal; }
.ui-hero-chips .chip-text { min-width: 0; overflow-wrap: anywhere; }
.ui-hero-title { font-size: var(--text-title); }
.stat-grid { gap: 24px; margin-bottom: 20px; }
.stat { background: var(--paper-2); border: 1px solid var(--sand6); border-radius: var(--r-md); padding: 10px 12px; box-shadow: var(--card-shadow); }
.stat-icon { background: transparent; box-shadow: none; }
.stat-value { font-size: var(--text-display); color: var(--sand12); }
.stat-body { min-width: 0; }
.stat-value { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.stat-label, .stat-sub { font-size: var(--text-sm); color: var(--sand11); }
.ui-progress-track { height: 8px; background: var(--sand4); border-radius: 999px; box-shadow: inset 0 1px 3px #78522833; }
.ui-progress-fill { background: linear-gradient(#9dc45a, #679732); box-shadow: inset 0 1px 0 #cde79088; }
.ui-progress--gold .ui-progress-fill { background: var(--amber9); }
.ui-progress--gem .ui-progress-fill { background: var(--sky8); }
.ui-progress-copy { margin-top: 4px; font-size: var(--text-sm); }
.ui-block { border: 0; background: transparent; border-radius: 0; box-shadow: none; }
.ui-block-head { padding: 8px 0 12px; }
.ui-block-body { padding: 16px 0 0; }
.ui-block-sub { font-size: var(--text-sm); }
.recipe-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; align-items: start; }
.recipe-card { padding: 16px; border: 1px solid var(--sand6); border-radius: 16px; background: linear-gradient(#fffaf0, #f5ebd6); gap: 12px; align-content: start; box-shadow: var(--card-shadow); }
.recipe-icon { width: 72px; height: 72px; flex-basis: 72px; background: transparent; border: 0; box-shadow: none; }
.recipe-icon .ui-item-art { width: 100%; height: 100%; }
.recipe-title strong { font-size: var(--text-title); }
.recipe-head { gap: 12px; flex-wrap: wrap; }
.recipe-title { flex-basis: 120px; }
.recipe-flow { padding: 12px; border: 1px solid #e9d6b1; background: #fffcf2; gap: 10px; border-radius: 12px; }
.recipe-flow .flow-arrow { color: #c98a35; font-size: 24px; }
.recipe-bench { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: stretch; gap: 12px; }
.recipe-bench .recipe-inputs { padding: 10px; border-radius: 12px; background: #f4e6c8; border: 1px solid #e1c99e; }
.recipe-bench .recipe-output { position: relative; flex-wrap: wrap; justify-content: center; gap: 4px 8px; padding: 10px; border: 1px solid #c2d997; border-radius: 12px; background: #f2f9de; }
.recipe-bench .recipe-output > .ui-icon { position: absolute; left: -16px; top: calc(50% - 12px); width: 24px; height: 24px; color: #c98a35; background: #fff9eb; border-radius: 50%; }
.recipe-bench .recipe-output > strong, .recipe-bench .recipe-output > .ui-price { flex-basis: 100%; text-align: center; justify-content: center; }
.recipe-bench .recipe-output > .demand-art { width: 58px; height: 58px; }
.recipe-rewards { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.recipe-actions { gap: 8px; }
.recipe-actions .action-button { min-height: 44px; }
.recipe-inputs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.recipe-input { display: inline-grid; grid-template-columns: 36px auto; gap: 2px 6px; align-items: center; font-size: var(--text-sm); }
.recipe-input .demand-art { grid-row: span 2; width: 36px; height: 36px; }
.recipe-input small { color: var(--sand11); font-size: var(--text-sm); }
.recipe-input.is-lack small { color: var(--tomato11); }
.recipe-output { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sand6); }
.recipe-output .demand-art { width: 52px; height: 52px; }
.recipe-output strong { font-size: var(--text-base); }
.queue-list { display: flex; flex-wrap: wrap; gap: 12px; counter-reset: batch; }
.queue-item { flex: 1 1 220px; padding: 16px; border: 1px solid var(--sand6); background: var(--paper-2); border-radius: var(--r-md); box-shadow: var(--card-shadow); }
.queue-item--ready { background: var(--amber2); border-color: var(--amber7); }
.queue-top .demand-art { width: 44px; height: 44px; }
.queue-top { gap: 8px; }
.queue-position { color: var(--sand11); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.order-grid { gap: 24px; }
.order-card { padding: 16px; border: 1px solid var(--sand6); background: var(--paper-2); gap: 16px; border-radius: var(--r-md); box-shadow: var(--card-shadow); }
.order-card--active { background: var(--grass2); border-color: var(--grass7); }
.order-head strong { font-size: var(--text-title); }
.demand { background: transparent; padding: 6px 0; gap: 12px; font-size: var(--text-base); border-radius: 0; }
.demand .demand-art { width: 52px; height: 52px; flex-basis: 52px; }
.demand--lack { color: var(--tomato11); }
.demand--lack .demand-count { background: var(--tomato3); padding: 3px 6px; border-radius: 4px; }
.reward-row { border-top: 1px solid var(--sand6); padding-top: 12px; gap: 12px; }
.reward-row .ui-price { background: transparent; }
.material-card, .field-card, .achv-card, .neighbor-card, .decor-card, .build-card { border: 1px solid var(--sand6); background: var(--paper-2); border-radius: var(--r-md); padding: 16px; box-shadow: var(--card-shadow); gap: 12px; }
.field-card--ready, .achv-card--done { background: var(--grass2); border-color: var(--grass7); }
.material-art, .field-art, .journal-art, .route-card .route-icon, .build-preview { background: transparent; border: 0; box-shadow: none; }
.material-art { width: 64px; height: 64px; flex-basis: 64px; }
.material-card .material-sell { gap: 8px; }
.decor-preview { background: radial-gradient(ellipse at 50% 30%, #f5e9ca, #ddcba0); box-shadow: inset 0 1px 4px #78522826; border: 1px solid var(--sand6); border-radius: var(--r-sm); height: 140px; }
.decor-preview svg { width: 100px; height: 100px; }
.decor-preview .guard-dog { width: 128px; height: 128px; }
.outfit-card .decor-preview { height: 128px; }
.outfit-card .decor-preview .guard-dog { width: 112px; height: 112px; }
.dog-card .decor-preview { height: 180px; }
.dog-card .decor-preview .guard-dog { width: 160px; height: 160px; }
.decor-card.is-active { border-color: var(--grass9); background: var(--grass2); box-shadow: none; }
.decor-card.is-dirty { border-color: var(--amber8); background: var(--amber2); box-shadow: none; }
.decor-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.decor-card .decor-actions .action-button, .decor-card .decor-actions .plain-button, .decor-card .decor-actions select { min-height: 44px; }
.land-grid { gap: 8px; }
.land-tile { border-color: var(--sand6); background: var(--sand2); padding: 10px 6px; }
.land-tile:hover { transform: none; border-color: var(--grass8); }
.land-tile[aria-current=true] { border-color: var(--grass9); background: var(--grass3); }
.land-tile .land-swatch { background: none; height: 40px; object-fit: contain; width: 100%; box-shadow: none; }
.land-tile--next { border-style: dashed; border-color: var(--grass8); }
.land-tile b, .land-tile small { font-size: var(--text-sm); }
.land-detail, .expand-card, .upgrade-row, .panel-lead { background: var(--paper-2); border: 1px solid var(--sand6); padding: 16px; border-radius: var(--r-md); box-shadow: var(--card-shadow); }
.expansion-preview { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.expansion-preview img { width: 110px; height: 76px; object-fit: contain; }
.timeline-item, .journal-tile, .ui-row, .route-card, .guide-step { border: 1px solid var(--sand6); background: var(--paper-2); border-radius: var(--r-sm); padding: 12px; box-shadow: inset 0 1px 0 #fbf1d8; }
.timeline-item .timeline-icon { background: var(--sand3); }
.ui-row-art, .ui-row-art--icon { background: transparent; box-shadow: none; }
.ui-row-art { width: 56px; height: 56px; flex-basis: 56px; }
.ui-empty-art { opacity: .75; }
.checkin-strip { grid-template-columns: repeat(auto-fit,minmax(92px,1fr)); gap: 8px; }
.checkin-day { padding: 12px 8px; background: var(--sand2); border: 1px solid var(--sand6); gap: 4px; font-size: var(--text-sm); }
.checkin-day--today { background: var(--amber3); border-color: var(--amber8); }
.checkin-day--done { background: var(--grass3); border-color: var(--grass7); }
.panel-section, .rules-note { background: var(--sand2); border: 1px solid var(--sand6); border-radius: var(--r-md); }
.panel-section > summary { min-height: 44px; padding: 12px 16px; background: transparent; }
.hint-card { border: 1px solid #a4b9a2; background: var(--sky3); border-radius: var(--r-md); color: var(--sky12); }
.hint-card--danger { background: var(--tomato3); color: var(--tomato12); }
.game-menu { border: 3px solid var(--wood-dark); border-radius: var(--r-lg); background: var(--paper) var(--grain); background-size: 6px 6px; box-shadow: var(--lift); }
.menu-head { padding: 12px 16px; }
.menu-title { color: var(--game-white); }
.menu-grid { gap: 4px; }
.menu-grid button { background: var(--control-fill); color: var(--wood-dark); border: 1px solid var(--sand6); min-height: 48px; box-shadow: var(--control-shadow); }
.menu-grid button:hover { background: var(--grass3); }
.menu-group { padding: 16px; }
.panel-connection { background: var(--amber3); color: var(--amber12); border-color: var(--amber7); }
.panel-connection[data-phase=offline], #panel-feedback.danger { background: var(--tomato3); color: var(--tomato11); border-color: var(--tomato7); }
.build-settings-actions { background: var(--paper-2); border: 1px solid var(--sand6); border-radius: var(--r-sm); box-shadow: var(--card-shadow); }
.exchange-option { background: var(--paper-2); border: 1px solid var(--sand6); box-shadow: var(--card-shadow); }
.preset-flow { color: var(--sky12); }
.preset-flow { gap: 6px; flex-wrap: wrap; }
.preset-side { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.preset-flow .ui-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.guide-step-index, .neighbor-avatar { background: var(--button-fill); color: var(--game-white); box-shadow: inset 0 1px 0 #cde79088, 0 2px 0 #486626; }
.preset-value { display: grid; gap: 2px; font-size: var(--text-title); font-variant-numeric: tabular-nums; }
.preset-value strong { white-space: nowrap; }
.preset-value small { font-size: var(--text-sm); font-weight: 400; color: var(--sand11); }
.land-upgrade-preview { display: flex; gap: 24px; align-items: center; padding: 16px 0; }
.land-upgrade-preview figure { margin: 0; display: grid; justify-items: center; gap: 8px; }
.land-upgrade-preview img { width: 96px; height: 50px; object-fit: contain; }
.land-upgrade-preview figcaption { font-size: var(--text-sm); }
@media (max-width: 1100px) {
  .items { grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }
  .topbar { grid-template-columns: 226px 284px minmax(0,1fr); gap: 10px; padding-inline: 12px; }
  .hud-nav { gap: 6px; flex-wrap: wrap; }
  .hud-nav button { width: 52px; flex-basis: 52px; }
}
@media (max-width: 900px) {
  .topbar { grid-template-columns: minmax(0, 226px) minmax(0, 284px); justify-content: space-between; }
  .hud-nav { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: nowrap; }
}
@media (min-width: 721px) and (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 720px) {
  .topbar { padding: 10px 10px 0; gap: 6px 8px; grid-template-columns: minmax(0,1fr) minmax(156px,45%); }
  .player { min-height: 54px; padding: 5px 8px 5px 31px; margin-left: 16px; border-radius: 28px; }
  .avatar { width: 52px; height: 52px; left: -21px; top: -1px; padding: 3px; }
  .player-top { gap: 3px; flex-wrap: wrap; }
  .farm-brand { font-size: 14px; }
  .level-chip { position: absolute; bottom: -4px; left: -14px; padding-inline: 5px; font-size: 10px; }
  .player-info strong { font-size: 10px; }
  .wallet { border-radius: 0; grid-template-columns: 1.25fr 1fr; gap: 4px; }
  .asset { min-height: 34px; gap: 2px; padding: 2px 4px; }
  .asset strong { font-size: 14px; }
  .asset img { width: 24px; height: 24px; flex-basis: 24px; }
  .asset-go { display: none; }
  .meter-pill { padding: 1px 4px; min-height: 18px; }
  .meter-track { width: 22px; flex-basis: 22px; }
  .meter-icon { width: 14px; height: 14px; flex-basis: 14px; }
  #production-copy { font-size: 10px; }
  .hud-nav { gap: 3px; justify-content: space-between; }
  .hud-nav button { flex: 1 1 0; width: auto; min-width: 0; min-height: 58px; font-size: 10px; gap: 4px; box-shadow: none; }
  .nav-emblem { width: 37px; height: 37px; flex-basis: 37px; border-radius: 13px; }
  .nav-emblem img { width: 32px; height: 32px; }
  .toolbar { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); width: min(408px, calc(100% - 24px)); max-width: none; gap: 4px 2px; padding: 6px 8px; bottom: max(12px,env(safe-area-inset-bottom)); border-radius: 24px; }
  .toolbar .tool-group { display: contents; }
  .toolbar .tool-sep { display: none; }
  .toolbar button { width: auto; height: 54px; padding: 0 0 2px; border-radius: 16px; }
  .toolbar button img { width: 36px; height: 34px; }
  .toolbar .tool-name { font-size: var(--text-sm) !important; }
  .scene-controls { left: 12px; bottom: calc(var(--tools-height) + 28px); padding: 0 4px; }
  .scene-btn { padding: 4px 8px; font-size: var(--text-sm); }
  dialog { width: calc(100% - 16px); max-height: calc(100dvh - 24px); border-radius: 22px; }
  .panel-head { padding: 10px 14px; }
  .panel-head h1 { font-size: 20px; }
  #panel-content { padding: 16px 12px; scrollbar-gutter: auto; scroll-padding-top: 16px; }
  #panel-tabs { margin-inline: 5px; padding: 9px 12px 11px; }
  #panel-tabs button { padding: 6px 12px; font-size: var(--text-sm); }
  .catalog-controls { padding: 10px 12px 12px; gap: 8px; }
  .items { grid-template-columns: 1fr; gap: 12px; }
  .catalog-item { display: grid; grid-template-columns: 88px minmax(0,1fr); align-items: start; gap: 6px 12px; padding: 10px; }
  .catalog-item > .item-art { grid-column: 1; grid-row: 1 / span 3; height: 104px; }
  .catalog-item > .item-name, .catalog-item > .item-meta { grid-column: 2; }
  .catalog-item > .item-line, .catalog-item > .trade-quote, .catalog-item > .trade-actions, .catalog-item > details, .catalog-item > .action-button { grid-column: 1 / -1; }
  .item-art { height: 100px; }
  .item-art img { width: 80px; height: 80px; }
  .item-art .item-count { right: 4px; bottom: 4px; font-size: 11px; padding: 1px 6px; background: #705428da; }
  .item-art .ui-item-art { width: 76px; height: 76px; }
  .item .item-lock { right: 0; top: 0; width: 44px; height: 44px; padding: 10px; background: #fffdf7f5; }
  .item-name, .item h2 { font-size: var(--text-base); }
  .item .ui-stepper { width: 174px; }
  .item .ui-stepper input { width: 100%; min-width: 0; }
  .item .item-line .tiny { margin-left: 0; }
  .item-meta .chip + .chip { margin-left: 0; }
  .item .ui-price { font-size: var(--text-base); }
  .pagination { justify-content: space-between; gap: 6px; }
  .pagination .plain-button { padding: 8px 12px; }
  .panel-toolbar .plain-button { flex: 1 1 auto; }
  [data-route=warehouse] > .stat-grid { gap: 6px; }
  [data-route=warehouse] > .stat-grid .stat { padding: 6px; gap: 3px; }
  [data-route=warehouse] > .stat-grid .stat-icon { display: none; }
  [data-route=warehouse] > .stat-grid .stat-value { font-size: 15px; }
  [data-route=warehouse] > .stat-grid .stat-label { font-size: 10px; }
  [data-route=warehouse] > .panel-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
  [data-route=warehouse] > .panel-toolbar button { min-height: 40px; padding: 7px 5px; font-size: var(--text-sm); }
  .stat-grid { gap: 12px; }
  .stat-value { font-size: var(--text-title); }
  .stat-label, .stat-sub { font-size: var(--text-sm); }
  .land-expand-body .stat-grid { grid-template-columns: 1fr; gap: 8px; }
  .ui-hero { gap: 12px; margin-bottom: 16px; padding-bottom: 16px; }
  .ui-hero-art { width: 64px; height: 64px; flex-basis: 64px; }
  .ui-hero-body { flex-basis: 160px; }
  .ui-hero-sub { font-size: var(--text-sm); }
  .ui-block-head { padding: 8px 0 12px; }
  .ui-block-body { padding: 12px 0 0; }
  .recipe-grid, .order-grid, .material-grid, .neighbor-grid { grid-template-columns: 1fr; gap: 16px; }
  .recipe-card, .order-card, .material-card, .field-card, .neighbor-card, .decor-card { padding: 12px; }
  .decor-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .decor-preview { height: 120px; }
  .dog-card { grid-column: 1 / -1; }
  .land-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .land-tile { padding: 8px 4px; }
  .land-tile strong { font-size: var(--text-sm); }
  .build-toggle { min-height: 44px; }
  .checkin-strip { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .checkin-day { padding: 10px 3px; }
  .checkin-day strong { font-size: var(--text-sm); }
}
@media (max-width: 360px) {
  .exchange-presets { grid-template-columns: 1fr; }
  .items { grid-template-columns: 1fr; }
  .item { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 6px 8px; }
  .item-art { grid-row: span 3; height: 100px; }
  .item-art img { width: 80px; height: 80px; }
  .item .item-quote, .item > .action-button, .item > .plain-button, .item > details, .item .item-line, .item > .trade-actions { grid-column: 1 / -1; }
  .item .item-line { justify-content: space-between; }
  .item .item-line .ui-stepper { width: 140px; }
  .plot-expand { width: 106px; column-gap: 3px; padding-inline: 5px; }
  .trade-actions { gap: 6px; }
  .trade-actions > .ui-stepper { flex-basis: 170px; width: 170px; }
  .trade-actions > .action-button, .trade-actions > .plain-button { padding-inline: 5px; }
  .decor-grid, .achv-grid, .journal-grid { grid-template-columns: 1fr; }
  .scene-zoom input { width: 58px; }
  .checkin-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-height: 500px) and (min-width: 600px) {
  .topbar { padding: 5px 10px 0; grid-template-columns: 190px 224px minmax(0,1fr); gap: 8px; }
  .player { min-height: 52px; margin-left: 16px; padding: 4px 8px 4px 35px; }
  .avatar { width: 52px; height: 52px; left: -20px; top: -2px; padding: 3px; }
  .farm-brand { font-size: 14px; }
  .wallet { gap: 3px 6px; }
  .asset { min-height: 32px; padding: 1px 5px; }
  .asset img { width: 24px; height: 24px; flex-basis: 24px; }
  .asset strong { font-size: 16px; }
  .asset-go { display: none; }
  .meter-pill { min-height: 16px; }
  .hud-nav { grid-column: auto; gap: 4px; flex-wrap: nowrap; }
  .hud-nav button { flex: 1 1 0; width: auto; min-width: 0; min-height: 52px; font-size: 10px; }
  .nav-emblem { width: 36px; height: 36px; flex-basis: 36px; border-radius: 12px; }
  .nav-emblem img { width: 30px; height: 30px; }
  dialog { width: min(1080px,calc(100% - 24px)); max-height: calc(100dvh - 16px); border-radius: var(--r-lg); }
  .panel-head { padding: 8px 16px; }
  #panel-content { padding: 16px; }
  .items { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
  .toolbar .tool-name { font-size: var(--text-sm) !important; }
  .scene-controls { padding: 0 4px; }
  .scene-btn { min-height: 40px; }
  .ui-hero { margin-bottom: 12px; padding-bottom: 12px; }
  .ui-hero-art { width: 48px; height: 48px; flex-basis: 48px; }
  .ui-hero-sub { font-size: var(--text-sm); }
  .stat-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
  .stat-value { font-size: var(--text-title); }
}
@media (prefers-reduced-motion: reduce) { .plot.reward .soil { animation: none; } }

progress { background: var(--sand4); border: 0; }
progress::-webkit-progress-bar { background: var(--sand4); }
progress::-webkit-progress-value { background: var(--grass9); }
progress::-moz-progress-bar { background: var(--grass9); }
.meter-track { background: var(--sand4); }
#production-fill { background: var(--sky8); }
.ui-stepper .stepper-btn { background: var(--control-fill); border: 0; }
.ui-stepper .stepper-btn:disabled { background: var(--sand3); }
.order-card { align-content: start; }
.order-actions { margin-top: auto; align-items: start; }
.order-actions .action-button, .order-actions .plain-button { min-height: 44px; }
.order-card .demand-list { min-height: 120px; align-content: center; }
.recipe-legacy { border-top: 1px solid var(--sand6); padding-top: 4px; }
.recipe-legacy summary { min-height: 44px; display: list-item; padding: 10px 0; color: var(--sand11); font-size: var(--text-sm); cursor: pointer; }
.recipe-legacy .recipe-actions { padding: 4px 0 8px; }
.workshop-build .recipe-head { display: grid; grid-template-columns: 80px 1fr; }
.workshop-build .recipe-icon { grid-row: span 2; }
.workshop-build .recipe-head > .chip { justify-self: start; }
.workshop-build .recipe-title { flex-basis: auto; }
@media (max-width:720px) { .order-card .demand-list { min-height: 0; } }

/* Inventory shelves, brass bookmarks and an unobtrusive world HUD. */
.theme-art-preview .theme-scene-preview { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.world { contain: strict; will-change: transform; }
#plots, #scene-markers, #buildings { contain: layout style; }
#theme-art { contain: strict; }
.plot { contain: layout style; }
button.plot[aria-busy=true] { filter: none; }
.topbar, .toolbar, .scene-notices { contain: layout style; }
.scene-btn:disabled { opacity: .42; cursor: default; box-shadow: inset 0 1px #efd9b7; }
.plot-expand { width: 82px; height: 32px; min-height: 0; padding: 2px 4px; grid-template-columns: 15px 1fr; gap: 0 3px; border-radius: 7px; transform: translate(-50%, -50%) scale(clamp(.8, var(--scene-ui-scale, 1), 1.05)); font-size: 9px; }
.plot-expand strong { font-size: 10px; line-height: 1.1; }
.plot-expand-icon { width: 15px; height: 23px; }
.plot-expand[data-state=ready]::after { display: none; }
.scene-highlight { isolation: isolate; }
.scene-highlight::before { content: ''; display: block !important; position: absolute; inset: -10px; z-index: 5; border: 3px solid #ffec9c; border-radius: 24px; background: #ffe0a51a; box-shadow: 0 0 0 7px #ffdf7733, 0 0 24px #ffe7a866; pointer-events: none; animation: scene-highlight 700ms ease-in-out 3; }
@keyframes scene-highlight { 0%, 100% { opacity: .35; transform: scale(.97); } 50% { opacity: 1; transform: scale(1.04); } }
.guardian-score { position: absolute; left: 50%; bottom: -15px; z-index: 4; transform: translateX(-50%) scale(var(--scene-ui-scale, 1)); transform-origin: center top; border: 1px solid #c09343; border-radius: 14px; padding: 3px 9px; white-space: nowrap; background: linear-gradient(#fff3c6, #e8c577); color: #604019; font-size: 11px; line-height: 1.3; font-weight: 700; box-shadow: 0 2px 3px #3c482233; }
.guardian-buddy { position: absolute; left: 50%; top: 5%; z-index: 4; width: max-content; max-width: 220px; padding: 6px 10px; border: 1px solid #c5a46d; border-radius: 12px 12px 12px 2px; background: #fff5d9; color: #654621; font-size: 12px; transform: translate(-50%, -100%) scale(var(--scene-ui-scale, 1)); transform-origin: bottom center; opacity: 0; pointer-events: none; transition: opacity 140ms; }
.has-buddy:hover .guardian-buddy, .has-buddy:focus-visible .guardian-buddy,
.buddy-greeting .guardian-buddy { opacity: 1; }
.has-buddy:hover .guardian-scene-art { animation: guardian-greet 550ms ease-in-out 2 !important; }
@keyframes guardian-greet { 50% { transform: translateY(-4px) rotate(-2deg); } }
.guardian-events { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.guardian-event { display: grid; grid-template-columns: 165px minmax(90px, .7fr) minmax(160px, 1fr); gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--sand5); font-size: 13px; }
.guardian-event time { color: var(--sand10); font-size: 12px; }
.guardian-alert { width: min(350px, calc(100vw - 32px)); padding: 20px 24px 24px; border: 3px solid #c49a50; border-radius: 24px; background: radial-gradient(ellipse at 50% 20%, #fff0be, #fff9e7 65%); color: #63451f; text-align: center; box-shadow: 0 18px 60px #253b3266; }
.guardian-alert::backdrop { background: #2436265c; }
.guardian-alert-art { width: 180px; height: 155px; margin: 0 auto -12px; animation: guardian-pounce 650ms cubic-bezier(.2,.8,.2,1) both; }
.guardian-alert-art > .guard-dog { transform: scale(2.05); transform-origin: 50% 53%; }
.is-guarding .guardian-scene-art { animation: guardian-pounce 650ms cubic-bezier(.2,.8,.2,1) both !important; }
.guardian-alert h2 { margin: 0 0 10px; font-family: 'FarmTitle', serif; color: #8b4e21; font-size: 27px; }
.guardian-alert p { margin: 0 0 8px; font-size: 14px; }
.guardian-alert small { display: block; margin-bottom: 18px; color: #88704a; font-size: 12px; }
.guardian-alert button { min-width: 120px; min-height: 44px; }
@keyframes guardian-pounce { from { opacity: 0; transform: translate(65px, 16px) scale(.76) rotate(-8deg); } 65% { opacity: 1; transform: translate(-9px, -5px) scale(1.05); } to { opacity: 1; transform: none; } }
@media (max-width:720px) { .guardian-event { grid-template-columns: 1fr 1fr; gap: 3px 8px; }.guardian-event time { grid-column: 1 / -1; } }
@media (prefers-reduced-motion:reduce) { .scene-highlight::before, .guardian-alert-art, .has-buddy:hover .guardian-scene-art, .is-guarding .guardian-scene-art { animation: none !important; } }
.house#house { pointer-events: auto; cursor: pointer; border: 0; padding: 0; background: transparent; }
.house#house img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
#building-kennel { z-index: 13; }
.crop-info { bottom: calc(var(--tools-height) + 30px); max-height: calc(100% - var(--hud-height) - var(--tools-height) - 54px); }
.crop-rules { font-size: 12px; color: #6c5a39; }
.crop-rules summary { cursor: pointer; min-height: 32px; padding-top: 8px; }
.crop-rules p { font-size: 12px; }
.tool-count { position: absolute; top: -6px; right: 0; min-width: 21px; padding: 2px 5px; border-radius: 8px; background: #42652d; color: #fff9dc; font: 700 12px/1.3 "FarmNumerals", sans-serif; }
.fertilizer-switch { position: fixed; z-index: 31; left: 50%; bottom: calc(var(--tools-height) + 14px); transform: translateX(-50%); min-height: 32px; padding: 4px 12px; border-radius: 12px; background: #fff6d9; color: #4d6332; border: 1px solid #a18b52; box-shadow: 0 3px 9px #343f2633; font-size: 12px; }
body:not([data-farm-tool="fertilize"]) .fertilizer-switch { display: none; }
.fertilizer-picker { inset: auto auto calc(var(--tools-height) + 52px) 50%; transform: translateX(-50%); width: min(320px, calc(100vw - 24px)); padding: 12px; border: 2px solid #9b6d36; border-radius: 14px; background: #fff7df; color: #4f3822; box-shadow: 0 8px 22px #253d2540; }
.picker-title { display: block; padding: 0 6px 7px; }
.fertilizer-option { width: 100%; display: flex; justify-content: space-between; gap: 6px; align-items: center; min-height: 44px; padding: 6px; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; }
.fertilizer-option.is-selected, .fertilizer-option:hover { background: #dce9bb; }
.fertilizer-option small { color: #576e35; }
body[data-farm-tool="fertilize"] .plot:not(.locked):hover .plot-hit { background: #98e64f66; outline: 2px solid #d6ff9a; }
.fertilizer-shortcut { flex: 1 1 100%; min-height: 44px; font-size: 13px; }
.fertilizer-context { margin: 0 0 10px; color: #4d6332; font-weight: 700; }
.fertilizer-daily { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px; margin-bottom: 14px; border-radius: 12px; background: #e4edcd; }
.fertilizer-daily .ui-item-art { width: 44px; height: 44px; }
.fertilizer-daily strong { flex: 1 1 150px; }
.village-banner { display: flex; align-items: center; gap: 20px; margin: 0 0 14px; padding: 4px 20px; background: linear-gradient(105deg,#e8efce,#f6e7b7); border-radius: 14px; min-height: 94px; }
.village-art { width: 88px; height: 88px; object-fit: contain; }
.village-title { min-width: 0; text-wrap: balance; font-family: "FarmTitle",serif; font-size: 22px; color: #536936; }
.village-slots { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.village-slot { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding: 16px; border-radius: 12px; background: #fff9e9; box-shadow: inset 0 -2px #e4cf9d; }
.village-slot h2 { font-size: 17px; line-height: 1.4; margin: 0; }
.village-slot p { margin: 0; line-height: 1.6; }
.village-slot > .item-art, .village-slot > .ui-item-art { width: 64px; height: 64px; min-height: 64px; align-self: center; margin: 0; }
.village-slot > .item-art img { width: 60px; height: 60px; }
.village-slot .action-button { margin-top: auto; }
.village-slot button { min-height: 44px; white-space: normal; }
.village-note { color: #6c5a39; font-size: 12px; line-height: 1.6; }
.voyage-reward { color: #507031; font-weight: 700; }
.field-effect { position: absolute; left: 0; top: 0; z-index: 12; width: 1px; height: 1px; pointer-events: none; contain: layout style; color: #5dcd69; }
.field-particle { position: absolute; width: 7px; height: 12px; border-radius: 80% 5% 80% 5%; background: currentColor; animation: field-spark .7s ease-out both; will-change: transform, opacity; }
.field-effect--water, .field-effect--careAll { color: #73d9eb; }
.field-effect--water .field-particle { border-radius: 70% 30% 65% 40%; }
.field-effect--harvest, .field-effect--harvestAll { color: #ffd252; }
.field-effect--harvest .field-particle, .field-effect--harvestAll .field-particle { border-radius: 50%; }
.field-float { display: block; margin-left: -65px; width: 130px; text-align: center; white-space: nowrap; color: #fffde1; text-shadow: 0 2px 3px #294b23; font-size: 15px; animation: field-float .9s ease-out both; will-change: transform, opacity; }
@keyframes field-spark { 0% { opacity: 0; transform: translate(0,8px) scale(.4) rotate(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx),var(--dy)) scale(.7) rotate(80deg); } }
@keyframes field-float { from { opacity: 0; transform: translateY(0) scale(.9); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-65px) scale(1); } }
@media (max-width:720px) and (min-height:561px) {
  .crop-info { bottom: calc(var(--tools-height) + 30px); max-height: calc(100% - var(--hud-height) - var(--tools-height) - 54px); }
  .toolbar { grid-template-columns: repeat(6,minmax(0,1fr)) !important; }
  .toolbar button[popovertarget="toolbox-menu"] { grid-column: span 2; }
  .village-banner { gap: 12px; padding: 4px 12px; min-height: 104px; margin-bottom: 12px; }
  .village-art { width: 96px; height: 96px; }
  .village-title { font-size: 24px; }
  .village-slots { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .village-slot { padding: 12px; gap: 7px; }
  .village-slot h2 { font-size: 15px; }
  .village-slot p { font-size: 12px; }
  .village-slot button { font-size: 12px; }
}
@media (max-width:360px) { .village-slots { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion:reduce) { .field-effect { display: none; } }
@font-face { font-family: "FarmNumerals"; src: url("assets/fonts/lilita-one.ttf") format("truetype"); font-display: swap; unicode-range: U+0000-00FF; }
:root {
  --game-ease: cubic-bezier(.34, 1.56, .64, 1);
  --oak-edge: #78461f;
  --oak-shadow: #4d301b;
  --shelf: #ecd09b;
  --shelf-light: #fff1c9;
  --game-type: "FarmTitle", "Microsoft YaHei", sans-serif;
}
.farm-brand, .level-chip, .asset strong, .tool-name, h1, h2, h3,
.slot-name, .slot-count, .slot-season, .catalog-assets strong,
.ui-price strong, .action-button, .plain-button, .panel-tab, .scene-btn {
  font-family: var(--game-type); font-weight: 800;
}
.action-button, .plain-button, .ghost-button, .panel-icon-btn, .scene-btn,
.hud-nav button, .toolbar button, .building, .inventory-slot {
  transition: transform 180ms var(--game-ease), opacity 180ms ease;
}
.action-button:hover:not(:disabled), .plain-button:hover:not(:disabled) { transform: translateY(-2px); }
.action-button:active:not(:disabled), .plain-button:active:not(:disabled) { transform: translateY(2px) scale(.98); }
.player { background: linear-gradient(#b9803f, #8b582b); border-color: #e2b26b; box-shadow: inset 0 2px 0 #ffe1a0, 0 3px 6px #3c48224d; }
.player-info strong { color: #fff3cc; text-shadow: 0 1px 2px #6c3b1a; }
.farm-brand { color: #fff9e4; font-size: 18px; text-shadow: 0 2px 2px #6c3b1a; }
.player-info progress { height: 6px; border: 1px solid #623e1f; background: #653f23; box-shadow: 0 1px #e6b76c; }
.player-info progress::-webkit-progress-bar { background: #653f23; }
.player-info progress::-webkit-progress-value { background: linear-gradient(#fff6ac, #c6e962); }
.player-top { align-items: center; }
.level-chip { font-size: 13px; }
.asset { min-height: 43px; border: 2px solid #efc875; background: linear-gradient(#784b26, #54351e); box-shadow: inset 0 2px #a97941, 0 3px 5px #3b4c243d; }
.asset strong { color: #fff4c5; font-size: 20px; text-shadow: 0 2px 2px #4d301b; }
.asset--coin .asset-text strong { color: #fff4c5; }
.asset strong, .ui-price strong, .slot-count, .slot-season, .catalog-assets strong, .level-chip { font-family: "FarmNumerals", var(--game-type); }
.asset--gem { background: linear-gradient(#437f7c, #235456); border-color: #9ee9e2; }
.asset--gem .asset-text strong { color: #efffff; }
.asset-go { display: none; }
.scene-notices { pointer-events: none; }
.viewport { overflow: clip; }
.scene-controls { left: 20px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.scene-btn { display: grid; place-items: center; width: 42px; height: 42px; min-height: 42px; padding: 8px; border: 2px solid #e8be73; border-radius: 50%; background: linear-gradient(#b58244, #81512a); box-shadow: inset 0 2px #f0cf91, 0 3px 5px #45572355; color: #fff3cd; }
.scene-btn:hover { background: linear-gradient(#c69854, #976331); transform: translateY(-2px); }
.scene-btn:active { transform: translateY(2px) scale(.95); }
.scene-btn .ui-icon { width: 23px; height: 23px; }
.zoom-button { font: 800 24px var(--game-type); }
.building-name { opacity: 0; padding: 2px 10px; border: 1px solid #a7753e; border-radius: 4px 8px 7px 4px; background: linear-gradient(#ffefba, #e8c88f); color: #603d1f; font: 800 12px/1.6 var(--game-type); text-shadow: 0 1px #fff4d2; box-shadow: 0 3px 5px #3f2c1c33; transition: opacity 160ms ease; pointer-events: none; }
.building:hover .building-name, .building:focus-visible .building-name { opacity: 1; }
.building:hover { transform: translateY(-2px); }
.building:active { transform: translateY(1px); }
/* The dock bitmap has transparent sky above its roof, overlapping plot 28. */
#buildings #building-dock { pointer-events: none; }
#building-dock .building-hit { position: absolute; inset: 22% 0 0; pointer-events: auto; }
.toolbar { padding: 9px 16px 7px; border: 3px solid #77461f; border-radius: 24px 24px 28px 28px; background: var(--wood-grain), linear-gradient(#dca75a 0 8%, #b77d3c 8% 88%, #a56c30 88%); box-shadow: inset 0 3px #ffe0a0, inset 0 -3px #875024, 0 5px 0 #70431f, 0 10px 14px #39431f55; }
.toolbar::before, .toolbar::after { content: ''; display: block; position: absolute; top: 50%; width: 7px; height: 7px; border: 1px solid #5f411f; border-radius: 50%; background: linear-gradient(#fff4c0, #b58c48); box-shadow: 0 1px 1px #603a1f; }
.toolbar::before { left: 5px; }.toolbar::after { right: 5px; }
.toolbar button { background: linear-gradient(#74491e38, #f9d08a1a); border: 1px solid #99602d66; border-radius: 14px; box-shadow: inset 0 2px 3px #693f1d38, 0 1px #f0bd75; }
.toolbar button img { width: 51px; height: 49px; margin-top: -17px; filter: drop-shadow(0 3px 2px #68461e40); }
.toolbar button:hover { transform: translateY(-4px); background: #ffedab42; }
.toolbar button:active { transform: translateY(2px) scale(.95); }
.toolbar .tool-name { padding-top: 3px; font-size: 12px !important; }
.tool-sep { margin-inline: 4px; }
dialog { width: min(1000px, calc(100% - 48px)); max-height: min(820px, calc(100dvh - 48px)); border: 4px solid #92602f; border-radius: 25px; background: #f4dfb4; box-shadow: inset 0 0 0 2px #f9d598, 0 5px 0 #65401f, 0 20px 50px #20331f66; }
dialog::backdrop { background: #19372270; }
.panel-head { padding: 12px 20px; border-bottom: 3px solid #a36a30; background: var(--wood-grain), linear-gradient(#e6b66e, #c98f47 15%, #af7333); box-shadow: inset 0 3px #ffe2aa, inset 0 -2px #e3b16a; }
.panel-head h1 { font-size: 25px; letter-spacing: 1px; text-shadow: 0 2px 2px #915523; }
.panel-icon-btn { background: linear-gradient(#ffebac, #dcab60); border: 2px solid #92581f; color: #7d481f; box-shadow: inset 0 2px #fff4d0, 0 2px 3px #85511f55; }
#panel-tabs { display: flex; flex: 0 0 auto; gap: 4px; margin: 0; padding: 8px 14px 0; overflow: visible; border: 0; background: linear-gradient(#dcb57d, #eacb98); mask-image: none; }
#panel-tabs button { flex: 1 1 0; min-width: 0; min-height: 38px; padding: 7px 4px 9px; border: 1px solid #b3854e; border-bottom: 0; border-radius: 9px 9px 0 0; background: linear-gradient(#eecf98, #ddbb82); box-shadow: inset 0 1px #ffe6b7; color: #77502c; white-space: nowrap; font-size: 13px; }
#panel-tabs button[aria-current=page] { background: linear-gradient(#fff3ce, #f6e5c0); color: #75441e; border-color: #b38243; text-shadow: 0 1px #fff5d8; box-shadow: inset 0 3px #eab64d; }
#panel-content { padding: 18px; background: radial-gradient(ellipse at top, #fff0ce, #f1deb7); scrollbar-gutter: auto; }
.catalog-controls { display: flex; padding: 10px 16px; gap: 8px; flex-wrap: nowrap; align-items: center; border: 0; background: #f6e5c0; box-shadow: inset 0 -1px #d0ae78; z-index: 3; }
.catalog-controls .catalog-field--search { flex: 1 1 150px; min-width: 0; width: auto; grid-column: auto; }
#catalog-search { width: 100%; min-height: 36px; height: 36px; border: 1px solid #c6a16b; border-radius: 18px; background: #ead4a9; box-shadow: inset 0 2px 3px #84562b22, 0 1px #ffefca; font-size: 13px; }
#catalog-search::placeholder { color: #84633d; }
.catalog-field--search .ui-icon { width: 16px; height: 16px; bottom: 10px; }
.catalog-filter { position: relative; flex: 0 0 auto; }
.catalog-filter summary, .catalog-filter-button { display: flex; align-items: center; justify-content: center; min-width: 64px; min-height: 36px; padding: 5px 13px; border: 1px solid #bb9359; border-radius: 18px; background: linear-gradient(#fbeac4, #e7c990); box-shadow: inset 0 1px #fff4d6, 0 2px #c09960; font: 800 13px var(--game-type); cursor: pointer; list-style: none; }
.catalog-filter summary::after { content: ''; width: 6px; height: 6px; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); margin: -3px 0 0 8px; }
.catalog-filter summary::-webkit-details-marker { display: none; }
.catalog-filter-button[aria-pressed=true] { background: var(--gold-fill); }
.catalog-filter-options { position: absolute; z-index: 5; right: 0; top: 42px; display: grid; grid-template-columns: 1fr; width: 112px; padding: 5px; border: 2px solid #b48749; border-radius: 12px; background: #f7e3b8; box-shadow: 0 6px 14px #583f2340; }
.catalog-filter-options button { min-height: 38px; border-radius: 7px; }
.catalog-filter-options button[aria-pressed=true] { background: #e8c47c; color: #70421e; }
#panel-content.catalog-surface { display: flex; flex-direction: column; min-height: 0; height: 590px; padding: 12px; overflow: hidden; }
.catalog-summary { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 0 2px 12px; }
.catalog-assets { display: flex; align-items: center; gap: 6px; min-width: 0; margin-right: auto; color: #805429; }
.catalog-assets .ui-price { margin-left: 8px; font-size: 15px; }
.catalog-assets > .ui-icon { color: #96692f; }
.catalog-summary > .action-button, .catalog-summary > .plain-button { min-height: 36px; padding: 5px 10px; font-size: 13px; }
.catalog-bulk-lock { display: grid; place-items: center; width: 34px; min-width: 34px; height: 36px; padding: 6px; color: #825428; border: 1px solid #c9a471; border-radius: 10px; background: #f4dfb6; }
.catalog-context { flex: 1; font: 800 14px var(--game-type); color: #866034; }
.catalog-workbench { display: grid; grid-template-columns: minmax(0, 1fr) 246px; gap: 16px; flex: 1; min-height: 0; }
.catalog-gallery { min-width: 0; overflow: auto; overscroll-behavior: contain; padding: 2px 7px 10px 2px; scrollbar-width: thin; scrollbar-color: #c69c60 transparent; }
.inventory-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-content: start; }
.inventory-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; min-height: 145px; padding: 8px 5px 12px; border: 2px solid #caa472; border-radius: 14px; background: radial-gradient(ellipse at 50% 26%, #fff5d9, #efdbb0 72%); box-shadow: inset 0 2px 4px #a6793e24, inset 0 -4px #e0bc7c, 0 2px 0 #b3874d; }
.slot-art { display: block; width: 88px; height: 82px; max-width: 94%; object-fit: contain; margin: -1px 0 3px; filter: drop-shadow(0 4px 2px #99723b2b); transition: transform 180ms var(--game-ease); }
.slot-name { font-size: 17px; color: #6e4725; line-height: 1.4; text-shadow: 0 1px #fff4d5; white-space: nowrap; }
.inventory-slot .ui-price { gap: 2px; font-size: 12px; line-height: 1.5; margin-top: 2px; align-self: flex-start; }
.inventory-slot .price-icon { width: 17px; height: 17px; }
.inventory-slot .ui-price strong { font-size: 13px; }
.slot-count { position: absolute; bottom: 10px; right: 5px; font-size: 12px; color: #846037; }
.slot-season { position: absolute; left: 5px; top: 4px; font-size: 10px; color: #916638; }
.slot-lock { position: absolute; right: 6px; top: 5px; width: 18px; height: 18px; color: #8c622c; }
.slot-reserved { position: absolute; top: 4px; left: 4px; padding: 0 4px; border-radius: 5px; color: #744415; background: #ffe09a; font-size: 10px; }
.slot-requirement { position: absolute; top: 25px; inset-inline: 3px; padding: 1px 2px; background: #f7e4bbeb; color: #825c38; font-size: 10px; border-radius: 4px; }
.inventory-slot.is-unavailable .slot-art { opacity: .65; }
.inventory-slot.is-picked { border-color: #da9a25; background: radial-gradient(ellipse at 50% 26%, #fff7d4, #f8d580); box-shadow: inset 0 0 0 2px #ffe9a0, inset 0 -4px #dba13d, 0 3px 0 #b58132; }
.inventory-slot:hover .slot-art { transform: translateY(-4px) scale(1.05); }
.inventory-slot:active { transform: translateY(2px) scale(.97); }
.catalog-inspector { min-width: 0; display: flex; flex-direction: column; align-items: stretch; align-self: stretch; padding: 16px; border: 2px solid #c39a62; border-radius: 18px; background: linear-gradient(#f8e5bc, #e9ce97); box-shadow: inset 0 2px #fff3d6, 0 2px #b08a50; }
.inspector-identity { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.inspector-identity .item-art { width: 120px; height: 112px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.inspector-identity .item-art img { width: 112px; height: 112px; }
.inspector-name { font-size: 24px; text-shadow: 0 1px #fff3ce; color: #75491f; }
.inspector-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.inspector-meta .chip { border: 0; background: #e5cc9b; padding: 2px 5px; font-size: 11px; }
.inspector-lock { display: flex; align-items: center; gap: 4px; min-height: 38px; padding: 4px 8px; color: #8d612e; font-size: 12px; }
.inspector-lock[aria-pressed=true] { color: #985a10; }
.inspector-controls { display: flex; flex-direction: column; gap: 12px; align-items: stretch; margin-top: 16px; padding-top: 0; }
.inspector-controls .ui-stepper { width: 100%; min-width: 0; }
.inspector-controls .trade-quote { padding: 0; min-height: 28px; border: 0; justify-content: center; margin: 0; }
.inspector-controls .trade-quote .ui-price { background: none; padding: 0; font-size: 24px; }
.inspector-controls .trade-quote .price-icon { width: 28px; height: 28px; }
.inspector-controls .quote-label:empty, .inspector-controls .quote-detail:empty { display: none; }
.catalog-inspector > .action-button { margin-top: auto; }
.inspector-controls > .action-button { min-height: 50px; font-size: 18px; }
.inspector-issue, .quote-message { color: #9a3f22; font-size: 12px; }
.inspector-rewards { margin-top: 16px; border-top: 1px solid #cbaa78; }
.inspector-rewards > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; color: #256576; font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
.inspector-rewards > summary::-webkit-details-marker { display: none; }
.inspector-rewards > summary::after { content: ''; width: 7px; height: 7px; margin-left: auto; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); }
.inspector-rewards[open] > summary::after { transform: rotate(225deg); }
.inspector-rewards > summary .ui-icon { width: 18px; height: 18px; }
.catalog-gallery .pagination { justify-content: center; margin: 16px 0 0; }
.catalog-gallery .pagination button { min-height: 34px; width: 40px; padding: 2px; }
.trade-quote .quote-label, .quote-detail:empty { display: none; }
.ui-hero { border: 0; margin-bottom: 8px; padding: 8px 0 2px; }
.ui-hero-body { align-content: center; }
.ui-hero-art { width: 92px; height: 92px; flex-basis: 92px; }
.ui-hero-chips { gap: 6px; }
.exchange-readiness { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 12px 0 20px; padding: 16px 0; border-block: 1px solid #cbaa78; }
.exchange-readiness > div { min-width: 0; }
.exchange-readiness dt { color: var(--ink-soft); font-size: 14px; }
.exchange-readiness dd { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; color: #256576; }
.exchange-readiness dd .ui-icon { width: 24px; height: 24px; flex-shrink: 0; }
.exchange-readiness strong { min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 28px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.quota-table { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; margin: 16px 0 20px; }
.quota-table > div { min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.quota-table dt { font-size: 12px; font-weight: 400; }
.quota-table dd { min-width: 0; overflow-x: auto; overflow-wrap: normal; white-space: nowrap; font-size: 15px; line-height: 1.5; font-weight: 600; }
[data-route="exchange"] .rules-note > summary { min-height: 44px; padding: 8px 12px; color: var(--sand11); font-size: 13px; }
.ui-block-sub { display: none; }
.ui-block-head { border-bottom: 1px solid #c8a472; padding: 10px 0 8px; }
.ui-block-body { padding-top: 10px; }
.stat-grid { gap: 10px; }
.stat-sub { display: none; }
.stat { background: #e9d1a466; box-shadow: none; border: 0; }
.recipe-grid { gap: 12px; }
.recipe-card { padding: 12px; gap: 8px; border: 2px solid #caa472; border-radius: 14px; background: linear-gradient(#fff0cc, #eed7a9); box-shadow: inset 0 1px #fff7dd, 0 2px #c4a06a; }
.recipe-head { gap: 9px; }
.recipe-icon { width: 48px; height: 48px; flex-basis: 48px; }
.recipe-title strong { font-size: 17px; }
.recipe-title strong, .material-name > strong, .queue-top > strong { font-family: var(--game-type); }
.recipe-title small { font-size: 11px; }
.recipe-flow { padding: 5px 0; border: 0; gap: 4px; background: none; }
.recipe-card .ui-cost { gap: 4px; font-size: 12px; }
.recipe-flow .ui-cost { background: none; border: 0; padding: 2px 0; }
.recipe-card .trade-quote { border: 0; padding: 0; }
.recipe-card .trade-quote .ui-price { background: none; padding: 0; }
.recipe-inputs { gap: 5px; }
.recipe-input { background: #e6c99655; border: 0; border-radius: 10px; }
.recipe-input > small { font-size: 10px; }
.recipe-bench { border: 0; padding: 5px; background: #ead09b66; }
.recipe-rewards { gap: 6px; }
.facility-build { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; margin: 8px 0; border: 2px solid #c49a61; border-radius: 12px; background: #efd5a2; }
.facility-build .ui-block-head { border: 0; padding: 0; }
.facility-build .ui-block-body { display: flex; align-items: center; gap: 10px; padding: 0; }
.queue-item { background: #f8e8c7; border: 1px solid #c6a676; padding: 10px; }
.material-card { padding: 10px; gap: 5px; background: #efd7ab; }
.material-art { width: 42px; height: 42px; flex-basis: 42px; }
.material-name { gap: 4px; }
.material-grid { grid-template-columns: 1fr; gap: 8px; }
.material-card { display: grid; grid-template-columns: minmax(0,1fr) auto 300px; align-items: center; gap: 8px 14px; }
.material-head { grid-column: 1; }
.material-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.material-name .chip { border: 0; background: none; padding: 0; }
.material-card > .trade-quote { grid-column: 2; border: 0; margin: 0; padding: 0; }
.material-card > .trade-actions { grid-column: 3; margin: 0; }
.workshop-links { justify-content: flex-end; gap: 6px; margin: 2px 0 10px; }
.workshop-links .plain-button { min-height: 32px; padding: 4px 10px; flex: 0 0 auto; font-size: 12px; border-radius: 8px; }
.rules-note { margin-top: 18px; }
.rules-note > summary { min-height: 36px; padding: 6px 0; font-size: 11px; color: #97744b; }
.workshop-construction { margin: 12px 0; background: #ead09e66; border: 1px solid #cbaa78; border-radius: 10px; }
.workshop-construction > summary { min-height: 36px; padding: 6px 10px; }
.workshop-construction > .ui-block { margin: 0; }
[data-route=products] .items, [data-route=fertilizers] .items { grid-template-columns: 1fr; gap: 10px; }
.item.product-entry { display: grid; grid-template-columns: 74px minmax(0,1fr) auto; gap: 4px 12px; align-items: center; padding: 10px; background: #f2dcae; }
.product-entry > .item-art { grid-column: 1; grid-row: 1 / span 3; width: 74px; height: 74px; border: 0; background: #e5c68d55; }
.product-entry > .item-art .ui-item-art { width: 68px; height: 68px; }
.product-entry > .item-name { grid-column: 2; font-size: 18px; }
.product-entry > .item-stock { grid-column: 2; grid-row: 2; justify-content: flex-start; }
.product-entry > .trade-quote { grid-column: 3; grid-row: 1; border: 0; padding: 0; justify-content: flex-end; }
.product-entry > .trade-actions { grid-column: 3; grid-row: 2 / span 2; }
.item.fertilizer-entry { display: grid; grid-template-columns: 70px minmax(0,1fr) auto auto; gap: 5px 12px; align-items: center; padding: 10px; background: #f2dcae; }
.fertilizer-entry > .item-art { grid-column: 1; grid-row: 1 / span 2; width: 70px; height: 76px; border: 0; background: #e5c68d55; }
.fertilizer-entry .item-art img { width: 64px; height: 64px; }
.fertilizer-entry .item-flag { display: none; }
.fertilizer-entry > .item-name { grid-column: 2; }
.fertilizer-entry > .fertilizer-duration { grid-column: 2; grid-row: 2; margin: 0; font-size: 12px; }
.fertilizer-entry > .action-button { grid-column: 3; grid-row: 1 / span 2; }
.fertilizer-entry > .fertilizer-buy { grid-column: 4; grid-row: 1 / span 2; padding-inline: 8px; }
.fertilizer-buy .ui-price { color: #417685; font-size: 16px; }
.inspector-enter { animation: inspector-reveal 220ms var(--game-ease); }
@keyframes inspector-reveal { from { transform: translateY(5px); opacity: .5; } to { transform: none; opacity: 1; } }
@supports (transition-behavior: allow-discrete) {
  dialog { opacity: 0; transform: translateY(10px) scale(.98); transition: opacity 160ms ease, transform 200ms var(--game-ease), display 200ms allow-discrete, overlay 200ms allow-discrete; }
  dialog[open] { opacity: 1; transform: none; }
}
dialog[open] { animation: game-open 240ms var(--game-ease); }
@keyframes game-open { from { transform: translateY(12px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 1100px) {
  .inventory-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 721px) and (max-width: 1100px) {
  .scene-controls { bottom: calc(var(--tools-height) + 32px); flex-direction: row; }
}
@media (max-width: 720px) {
  .player { padding-left: 29px; min-height: 51px; }
  .farm-brand { font-size: 14px; }.level-chip { font-size: 11px; }
  .player-info strong { font-size: 10px; }
  .asset { min-height: 34px; padding: 2px 4px; }.asset strong { font-size: 15px; }
  .asset img { width: 25px; height: 25px; }
  .scene-controls { bottom: calc(var(--tools-height) + 28px); left: 12px; flex-direction: row; gap: 6px; }
  .scene-btn { width: 36px; height: 36px; min-height: 36px; padding: 6px; border-width: 1.5px; }
  .toolbar { padding: 9px 10px 6px; width: min(410px, calc(100% - 24px)); gap: 5px; border-radius: 22px; }
  .toolbar button { height: 51px; border-radius: 11px; }
  .toolbar button img { width: 40px; height: 39px; margin-top: -9px; }
  .toolbar .tool-name { font-size: 11px !important; }
  dialog { width: calc(100% - 16px); max-height: calc(100dvh - 28px); border-width: 3px; border-radius: 20px; }
  .panel-head { padding: 8px 12px; }.panel-head h1 { font-size: 22px; }
  #panel-tabs { gap: 2px; margin: 0; padding: 7px 6px 0; }
  #panel-tabs button { min-height: 36px; padding: 6px 1px 8px; font-size: 11px; border-radius: 7px 7px 0 0; }
  .catalog-controls { padding: 8px 10px; gap: 6px; }
  .catalog-filter summary, .catalog-filter-button { min-width: 54px; padding-inline: 9px; min-height: 34px; font-size: 12px; }
  #catalog-search { min-height: 34px; height: 34px; font-size: 12px; }
  #panel-content { padding: 12px; }
  #panel-content.catalog-surface { height: calc(100dvh - 199px); min-height: 260px; padding: 10px; }
  .catalog-workbench { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; gap: 8px; }
  .catalog-summary { gap: 4px; padding-bottom: 9px; }
  .catalog-assets { gap: 3px; font-size: 11px; flex-wrap: wrap; }
  .catalog-assets > .ui-icon { display: none; }
  .catalog-assets .ui-price { margin-left: 3px; font-size: 12px; }
  .catalog-summary > .action-button { font-size: 11px; min-height: 34px; padding: 5px 7px; white-space: nowrap; }
  .catalog-bulk-lock { width: 30px; min-width: 30px; height: 34px; padding: 5px; }
  .catalog-context { font-size: 12px; }
  .catalog-gallery { padding: 2px 3px 7px 2px; }
  .inventory-slots { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
  .inventory-slot { min-height: 126px; padding: 6px 4px 10px; border-radius: 12px; }
  .slot-art { width: 72px; height: 69px; }
  .slot-name { font-size: 14px; }
  .slot-count { font-size: 10px; right: 4px; bottom: 10px; }
  .inventory-slot .ui-price { font-size: 10px; gap: 1px; }.inventory-slot .ui-price strong { font-size: 11px; }
  .inventory-slot .price-icon { width: 14px; height: 14px; }
  .catalog-inspector { max-height: min(45dvh, 300px); padding: 10px; border-radius: 14px; }
  .inspector-identity { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 2px 8px; align-items: center; }
  .inspector-identity .item-art { grid-row: 1 / span 2; width: 44px; height: 44px; }
  .inspector-identity .item-art img { width: 44px; height: 44px; }
  .inspector-name { font-size: 17px; grid-column: 2; }
  .inspector-meta { grid-column: 2; gap: 5px; justify-content: flex-start; }
  .inspector-meta .ui-price { font-size: 12px; }.inspector-meta .price-icon { width: 17px; height: 17px; }
  .inspector-meta .chip { font-size: 10px; padding: 0 4px; }
  .inspector-lock { grid-column: 3; grid-row: 1 / span 2; min-height: 42px; padding: 3px; font-size: 11px; }
  .inspector-controls { display: grid; grid-template-columns: minmax(0,1fr) 115px; gap: 8px; margin-top: 8px; padding-top: 0; align-items: center; }
  .inspector-controls .ui-stepper { grid-column: 1; grid-row: 1 / span 2; grid-template-columns: 36px minmax(32px,1fr) 36px 38px; width: 100%; min-width: 0; }
  .inspector-controls .trade-quote { min-height: 20px; grid-column: 2; grid-row: 1; }
  .inspector-controls .trade-quote .ui-price { font-size: 20px; }
  .inspector-controls .trade-quote .price-icon { width: 21px; height: 21px; }
  .inspector-controls > .action-button { grid-column: 2; grid-row: 2; min-height: 44px; padding: 5px; font-size: 15px; }
  .inspector-controls .quote-message { font-size: 10px; }
  .catalog-inspector > .action-button { margin-top: 8px; min-height: 42px; }
  .inspector-rewards { margin-top: 8px; }
  .exchange-readiness { gap: 12px; margin-block: 8px 16px; padding-block: 12px; }
  .exchange-readiness strong { font-size: 24px; }
  .exchange-readiness dd .ui-icon { width: 20px; height: 20px; }
  .quota-table { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .ui-hero { flex-wrap: nowrap; gap: 12px; }.ui-hero-art { width: 68px; height: 68px; flex-basis: 68px; }
  .ui-hero-body { flex: 1; }.ui-hero-chips .chip { font-size: 11px; }
  .recipe-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .recipe-card { padding: 10px; gap: 6px; }
  .recipe-card .trade-actions { gap: 8px; }
  .recipe-card .trade-actions > .ui-stepper { flex: 1 1 155px; min-width: 140px; width: auto; grid-template-columns: 34px minmax(32px,1fr) 34px 40px; }
  .recipe-card .trade-actions > .action-button { flex: 1 1 100px; }
  .recipe-icon { width: 42px; height: 42px; flex-basis: 42px; }.recipe-title strong { font-size: 16px; }
  .facility-build { flex-wrap: wrap; }.facility-build .ui-block-body { margin-left: auto; }
  .material-grid { grid-template-columns: 1fr; }
  .material-card { grid-template-columns: minmax(0,1fr) auto; gap: 5px; }
  .material-card > .trade-actions { grid-column: 1 / -1; }
  .material-card > .trade-quote { grid-column: 2; }
  .material-name .ui-price { display: none; }
  .material-card .trade-actions > .ui-stepper { flex: 1; min-width: 140px; grid-template-columns: 34px minmax(28px,1fr) 34px 36px; }
  .ui-block { margin-bottom: 16px; }
  .item.product-entry { grid-template-columns: 58px minmax(0,1fr) auto; gap: 4px 8px; }
  .product-entry > .item-art { width: 58px; height: 66px; grid-row: 1 / span 2; }
  .product-entry > .item-art .ui-item-art { width: 54px; height: 54px; }
  .product-entry > .trade-quote { grid-column: 3; grid-row: 1 / span 2; }
  .product-entry > .trade-actions { grid-column: 1 / -1; grid-row: 3; }
  .item.fertilizer-entry { grid-template-columns: 55px minmax(0,1fr) 96px; gap: 4px 8px; }
  .fertilizer-entry > .item-art { width: 55px; height: 66px; grid-row: 1 / span 2; }
  .fertilizer-entry .item-art img { width: 52px; height: 52px; }
  .fertilizer-entry > .item-name { grid-column: 2; font-size: 15px; }
  .fertilizer-entry > .action-button { grid-column: 3; grid-row: 1; min-height: 35px; padding: 4px; font-size: 12px; }
  .fertilizer-entry > .fertilizer-buy { grid-column: 3; grid-row: 2; min-height: 32px; }
}
@media (max-width: 350px) {
  .inventory-slots { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quota-table { grid-template-columns: minmax(0,1fr); }
  #panel-tabs button { font-size: 10px; }
  .inspector-controls { grid-template-columns: minmax(0,1fr) 100px; gap: 6px; }
  .inspector-controls .ui-stepper { grid-template-columns: 30px minmax(26px,1fr) 30px 33px; }
  .inspector-meta .chip:last-child:not(:first-child) { display: none; }
  .asset strong { font-size: 13px; }
  .farm-brand { font-size: 12px; }
}
@media (max-height: 520px) and (min-width: 560px) {
  .player { min-height: 44px; padding-left: 26px; }.farm-brand { font-size: 12px; }
  .player-info strong { font-size: 9px; }.avatar { width: 46px; height: 46px; }
  .scene-controls { flex-direction: row; bottom: 13px; }
  .scene-btn { width: 32px; height: 32px; min-height: 32px; padding: 5px; }
  .toolbar { width: max-content; display: flex; padding: 6px 12px 4px; bottom: 10px; }
  .toolbar button { width: 43px; height: 43px; }.toolbar button img { width: 32px; height: 30px; }
  #panel-content.catalog-surface { height: 240px; min-height: 180px; }
  .catalog-workbench { grid-template-columns: minmax(0,1fr) 220px; grid-template-rows: minmax(0,1fr); }
  .catalog-inspector { padding: 10px; }.inspector-identity .item-art { display: none; }
  .inspector-identity { gap: 5px; }.inspector-name { font-size: 18px; }
  .inspector-controls { padding-top: 8px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.harvest-reward { display: grid; gap: 10px; padding-block: 12px; border-block: 1px solid #d8c49a; margin-block: 12px; }
.harvest-reward > .chip { justify-self: start; font-size: 14px; padding: 5px 10px; font-weight: 700; }
.harvest-reward-parts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 6px; margin: 0; }
.harvest-reward-parts > div { display: grid; gap: 3px; }
.harvest-reward-parts dt { color: #675733; font-size: 11px; }
.harvest-reward-parts dd { margin: 0; color: #256576; font: 700 17px/1.2 'FarmNumerals',sans-serif; }
.harvest-reward-note { color: #675733; font-size: 12px; line-height: 1.6; margin-block: 8px; }
.diamond-pools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; padding-block: 6px 10px; }
.diamond-schedule { display: grid; gap: 0; }
.diamond-schedule > div { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 16px; padding-block: 12px; border-bottom: 1px solid #e2d4b5; line-height: 1.6; }
.diamond-schedule strong { font-weight: 700; color: #4c532a; }
.diamond-schedule span { color: #625236; font-size: 13px; }
.catalog-inspector .harvest-reward { margin-block: 2px; padding-block: 10px; }
.catalog-inspector .harvest-reward-note { margin: 0; font-size: 11px; }
.catalog-inspector { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c69c60 transparent; }
.catalog-inspector > * { flex-shrink: 0; }
@media (max-width:720px) {
  .diamond-pools { grid-template-columns: 1fr; gap: 16px; }
  .diamond-schedule > div { grid-template-columns: 72px minmax(0,1fr); gap: 10px; }
  .catalog-inspector .harvest-reward { grid-column: 1 / -1; }
  .catalog-inspector .harvest-reward-note { grid-column: 1 / -1; }
}

/* Monthly rewards keep the existing parchment, with amber weekly seals. */
.monthly-checkin { --checkin-amber: #92601c; --checkin-line: #d9bd83; --checkin-violet: #55336d; }
.checkin-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.checkin-summary h2 { margin: 0; font: 600 23px/1.3 'FarmTitle',serif; color: #754b24; }
.checkin-summary > .action-button { min-height: 44px; }
.monthly-checkin { margin-bottom: 26px; }
.checkin-body { display: grid; gap: 14px; }
.checkin-milestones { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) minmax(0,1.45fr); gap: 8px; }
.checkin-milestone { position: relative; display: grid; grid-template-columns: 35px minmax(0,1fr); align-items: center; gap: 2px 8px; padding: 9px; border: 1px solid #d5ab57; border-radius: 12px; background: linear-gradient(135deg,#fff5d4,#edcc83); color: #775020; box-shadow: inset 0 1px #fff7d9; }
.checkin-milestone > img { grid-row: span 2; width: 35px; height: 35px; object-fit: contain; }
.checkin-milestone > span { font-size: 11px; }
.checkin-milestone > strong { font: 700 21px/1.1 'FarmNumerals',serif; }
.checkin-milestone > small { grid-column: 1 / -1; font-size: 11px; line-height: 1.5; text-align: center; font-variant-numeric: tabular-nums; }
.checkin-milestone--grand { background: linear-gradient(125deg,#39274e,#765087); border-color: #cda462; color: #ffebbd; box-shadow: inset 0 1px #edcf9144,0 3px 12px #4b28551a; }
.checkin-milestone.is-complete { opacity: .68; }
.monthly-checkin .checkin-calendar { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px; animation: checkin-arrive 260ms ease-out both; }
.checkin-calendar .checkin-day { min-width: 0; min-height: 78px; position: relative; align-content: center; gap: 4px; padding: 17px 5px 7px; border: 1px solid #dbcba7; border-radius: 12px; background: linear-gradient(145deg,#fff8e7,#f4e7cc); color: #725c38; text-align: center; }
.checkin-day .checkin-day-number { position: absolute; left: 8px; top: 5px; color: #8a7651; font: 600 11px/1.2 'FarmNumerals',serif; }
.checkin-day strong.checkin-day-prize { display: flex; gap: 3px; align-items: baseline; font: 700 27px/1.1 'FarmNumerals',serif; color: #386f78; }
.checkin-day-prize small { font: 500 10px/1.2 'FarmTitle',serif; }
.checkin-day-coins { display: flex; align-items: center; gap: 3px; font-size: 10px; font-variant-numeric: tabular-nums; }
.checkin-day-coins img { width: 10px; height: 10px; object-fit: contain; }
.checkin-coins-compact { display: none; }
.checkin-day-extras { min-width: 0; max-width: 100%; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.checkin-calendar .checkin-day--weekly { border-color: #c99a3c; background: radial-gradient(ellipse at 50% 20%,#fff7c9,transparent 70%),linear-gradient(145deg,#ffe4a0,#e9bd65); color: #6e471b; box-shadow: inset 0 1px #fff9dc,0 2px 6px #9c651a14; }
.checkin-day--weekly strong.checkin-day-prize { color: #74460d; }
.checkin-prize-art { width: 34px; height: 30px; object-fit: contain; }
.checkin-day--weekly .checkin-prize-art { position: absolute; width: 22px; height: 22px; right: 4px; top: 4px; }
.checkin-day--weekly .checkin-done-mark { top: auto; bottom: 3px; }
.checkin-day--weekly .checkin-day-extras { font-size: 9px; }
.checkin-calendar .checkin-day--grand { grid-column: span 6; min-height: 94px; display: grid; grid-template-columns: 54px max-content minmax(0,1fr); column-gap: 16px; justify-items: start; text-align: left; padding: 12px 18px; border-color: #caab70; background: radial-gradient(ellipse at 85% 0,#a57db33d,transparent 65%),linear-gradient(120deg,#382745,#67467c); color: #f5e0bc; box-shadow: inset 0 0 0 3px #f5d38e1c,0 4px 15px #56396122; overflow: hidden; }
.checkin-day--grand .checkin-day-number { color: #edc781; }
.checkin-day--grand .checkin-prize-art { grid-row: 1 / span 3; width: 52px; height: 52px; }
.checkin-day--grand strong.checkin-day-prize { grid-row: 1 / span 2; font-size: 48px; color: #ffe5a3; text-shadow: 0 2px #2b153b; }
.checkin-day--grand .checkin-day-prize small { font-size: 14px; }
.checkin-day--grand .checkin-grand-title { grid-column: 3; grid-row: 1; align-self: end; color: #fff0cc; font: 600 19px/1.3 'FarmTitle',serif; }
.checkin-day--grand .checkin-day-extras { grid-column: 3; grid-row: 2; font-size: 11px; color: #e4ccea; }
.checkin-day--grand .checkin-day-coins { grid-column: 2 / -1; grid-row: 3; font-size: 12px; }
.checkin-day--grand::after { content: ''; position: absolute; inset: -70% auto -70% -30%; width: 20%; background: linear-gradient(90deg,transparent,#fff2d42b,transparent); transform: rotate(25deg); pointer-events: none; animation: checkin-shine 1100ms 250ms ease-out both; }
.checkin-calendar .checkin-day--done { background: #ebe7d7; border-color: #ced0b4; box-shadow: none; }
.checkin-calendar .checkin-day--weekly.checkin-day--done { background: linear-gradient(145deg,#f7e7bb,#e3cf9f); border-color: #cbb07a; }
.checkin-day--done strong.checkin-day-prize { color: #6e7955; }
.checkin-done-mark { position: absolute; right: 5px; top: 5px; color: #496237; font-size: 9px; }
.checkin-calendar .checkin-day--today { border-color: #57813f; outline: 2px solid #83a35d; outline-offset: 1px; box-shadow: 0 0 0 4px #7d9c5420; }
.checkin-calendar .checkin-day--grand.checkin-day--done { background: linear-gradient(120deg,#594760,#786781); }
.checkin-day--grand.checkin-day--done .checkin-day-prize { color: #ffe5a3; }
.checkin-day--grand .checkin-done-mark { color: #fff0cc; }
.checkin-actions { justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.checkin-reset { color: #7c6b4e; font-size: 11px; }
.checkin-actions .action-button { min-width: 180px; min-height: 44px; }
.fruit-diamond-capsule { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; padding: 8px 10px; border: 1px solid #83b5bc; border-radius: 12px; background: linear-gradient(120deg,#f0ffff,#d7f0ee 55%,#e8e4f5); color: #245f6e; box-shadow: inset 0 1px #fff,0 2px 7px #327c8612; }
.fruit-diamond-capsule > .ui-icon { flex-shrink: 0; width: 19px; height: 19px; }
.fruit-diamond-capsule > strong { font-size: 14px; line-height: 1.3; }
.fruit-diamond-capsule > span { flex-basis: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
@keyframes checkin-arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes checkin-shine { from { left: -30%; } to { left: 130%; } }
@media (max-width:720px) {
  .checkin-summary h2 { font-size: 19px; }
  .checkin-summary .chip { font-size: 10px; }
  .checkin-summary > .action-button { flex: 1 1 100%; }
  .checkin-body { gap: 10px; }
  .checkin-milestones { gap: 5px; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .checkin-milestone { grid-template-columns: 23px minmax(0,1fr); gap: 2px 4px; border-radius: 8px; padding: 6px 4px; }
  .checkin-milestone > img { width: 23px; height: 26px; }
  .checkin-milestone > span { font-size: 9px; }
  .checkin-milestone > strong { font-size: 16px; }
  .checkin-milestone--grand { grid-column: 1 / -1; grid-template-columns: 30px minmax(0,1fr) auto; padding: 6px 12px; }
  .checkin-milestone--grand > img { grid-row: auto; width: 28px; height: 26px; }
  .checkin-milestone--grand > span { font-size: 13px; }
  .checkin-milestone--grand > strong { font-size: 25px; }
  .monthly-checkin .checkin-calendar { gap: 4px; }
  .checkin-calendar .checkin-day { min-height: 76px; padding: 19px 2px 7px; gap: 4px; border-radius: 7px; }
  .checkin-day .checkin-day-number { top: 4px; left: 5px; font-size: 10px; }
  .checkin-day strong.checkin-day-prize { font-size: 21px; gap: 2px; }
  .checkin-day--weekly strong.checkin-day-prize { font-size: 18px; gap: 1px; }
  .checkin-day--weekly .checkin-day-prize small { font-size: 7px; }
  .checkin-day-prize small { font-size: 9px; }
  .checkin-day-coins { font-size: 9px; line-height: 1.2; gap: 2px; }
  .checkin-day-coins img { width: 9px; height: 9px; }
  .checkin-coins-value { display: none; }
  .checkin-coins-compact { display: inline; }
  .checkin-day--grand .checkin-coins-value { display: inline; }
  .checkin-day--grand .checkin-coins-compact { display: none; }
  .checkin-day-extras { font-size: 8px; line-height: 1.3; }
  .checkin-prize-art { width: 24px; height: 24px; }
  .checkin-day--weekly .checkin-prize-art { width: 15px; height: 15px; top: 3px; right: 2px; }
  .checkin-done-mark { font-size: 7px; right: 2px; }
  .checkin-calendar .checkin-day--grand { grid-template-columns: 34px minmax(0,1fr); gap: 4px 9px; min-height: 104px; padding: 16px 10px 9px; }
  .checkin-day--grand .checkin-prize-art { width: 34px; height: 38px; grid-row: 1 / span 2; }
  .checkin-day--grand strong.checkin-day-prize { grid-column: 2; grid-row: 1; font-size: 37px; }
  .checkin-day--grand .checkin-grand-title { grid-column: 2; grid-row: 2; font-size: 12px; }
  .checkin-day--grand .checkin-day-extras { grid-column: 1 / -1; grid-row: 4; font-size: 9px; }
  .checkin-day--grand .checkin-day-coins { grid-column: 1 / -1; grid-row: 3; font-size: 10px; }
  .checkin-actions { flex-wrap: wrap; }
  .checkin-actions .action-button { flex: 1 1 100%; }
  .checkin-reset { width: 100%; text-align: center; order: 1; font-size: 10px; }
  .fruit-diamond-capsule > strong { font-size: 13px; }
  .fruit-diamond-capsule > span { font-size: 11px; }
}
@media (max-width:350px) {
  .checkin-milestone { grid-template-columns: 1fr; justify-items: center; gap: 1px; }
  .checkin-milestone > img { display: none; }
  .checkin-milestone--grand { grid-template-columns: minmax(0,1fr) auto; }
  .checkin-day strong.checkin-day-prize { font-size: 17px; gap: 1px; }
  .checkin-day-prize small { font-size: 7px; }
  .checkin-day--weekly strong.checkin-day-prize { font-size: 16px; }
  .checkin-day--weekly .checkin-day-prize small { display: none; }
  .checkin-done-mark { top: 15px; right: 3px; }
}
@media (prefers-reduced-motion:reduce) {
  .monthly-checkin .checkin-calendar, .checkin-day--grand::after { animation: none; }
}

/* Three breathing zones: identity/assets, today's priorities, six destinations. */
.topbar {
  --hud-amber: #edcb83;
  --hud-ink: #59401f;
  --hud-type: "Microsoft YaHei", "PingFang SC", sans-serif;
  padding: 18px max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  grid-template-columns: 464px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}
.hud-home { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0; }
.hud-home .player { min-height: 62px; padding: 5px 10px 5px 44px; }
.hud-home .player-top { flex-wrap: nowrap; gap: 4px; }
.hud-home .farm-brand { font-size: 16px; white-space: nowrap; }
.hud-home .level-chip { position: static; font-size: 11px; padding-inline: 5px; }
.hud-home .wallet { position: static; grid-column: auto; grid-row: auto; justify-self: stretch; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); min-width: 0; width: 100%; padding: 0; gap: 5px 8px; }
.wallet .asset { min-width: 0; min-height: 42px; }
.wallet .asset img { display: block; flex: 0 0 28px; width: 28px; height: 28px; }
.wallet .asset strong { font-size: 19px; }
.wallet #production-progress { position: relative; inset: auto; grid-column: 1 / -1; display: flex; min-height: 24px; height: 24px; gap: 4px; padding: 2px 8px; overflow: hidden; border: 1px solid #b6d3bd; border-radius: 999px; background: linear-gradient(110deg, #285c55f2, #376a5bf2); color: #f5f7da; box-shadow: inset 0 1px #d5f2cc55, 0 2px 4px #2d48252b; }
.wallet .meter-icon { display: inline-flex; flex: 0 0 13px; width: 13px; height: 13px; color: #ebf4b6; }
.wallet .meter-body { display: flex; min-width: 0; width: auto; }
.wallet .meter-copy { display: flex; align-items: center; white-space: nowrap; gap: 2px; font: 600 10px/1.2 var(--hud-type); font-variant-numeric: tabular-nums; }
.wallet #production-copy { display: inline; color: inherit; font: inherit; overflow: visible; }
.wallet .meter-divider { margin-inline: 2px; color: #bad8be; }
.wallet .meter-gem { display: inline-block; width: 12px; height: 12px; object-fit: contain; }
.wallet .meter-track { position: absolute; inset: auto 8px 1px; width: auto; height: 2px; border: 0; background: #123e3980; }
.wallet #production-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #98c5a1, #e1f6ba, #b0f1de); transition: width 320ms var(--game-ease); }
.wallet #production-progress:hover { border-color: #e2f3c2; filter: brightness(1.12); }
#task-strip { position: static; inset: auto; grid-column: auto; grid-row: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; justify-self: center; width: max-content; max-width: 100%; gap: 8px; padding: 0; pointer-events: auto; }
#task-strip[hidden] { display: none; }
.task-strip .task-chip { display: inline-flex; align-items: center; gap: 5px; width: auto; height: 34px; min-height: 34px; padding: 4px 11px 4px 7px; position: relative; border: 1px solid #bba16a; border-radius: 999px; background: linear-gradient(#fff9e6f5, #f1e3bbf5); color: var(--hud-ink); box-shadow: inset 0 1px #fff9e6, 0 2px 5px #48623326; font: 700 12px/1.3 var(--hud-type); white-space: nowrap; transition: transform 180ms var(--game-ease), box-shadow 180ms var(--game-ease); animation: hud-focus-arrive 280ms var(--game-ease) both; }
.task-strip .task-chip:nth-child(2) { animation-delay: 45ms; }
.task-strip .task-chip:nth-child(3) { animation-delay: 90ms; }
.task-strip .task-icon { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; padding: 2px; border-radius: 50%; background: #d7c79d66; }
.task-strip .task-icon .ui-icon { width: 17px; height: 17px; }
.task-strip .task-label { position: static; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; }
.task-strip .task-chip--daily { border-color: #d39a40; background: linear-gradient(#ffe9a8, #f1c96e); color: #644015; box-shadow: inset 0 1px #fff6d5, 0 3px 7px #9b73322b; }
.task-strip .task-chip--gem { border-color: #7daf9c; background: linear-gradient(#eefbebf5, #c6e5d6f5); color: #24584d; }
.task-strip .task-chip--care { color: #3a5928; border-color: #9db17a; }
.task-strip .task-chip--quiet { color: #4c6244; background: #f6fae5dc; border-color: #b4c39b; box-shadow: inset 0 1px #ffffffe0; }
.task-strip .task-chip:hover { transform: translateY(-2px); box-shadow: inset 0 1px #fff9e6, 0 5px 9px #48623330; }
.task-strip .task-chip:active { transform: translateY(1px) scale(.97); }
.hud-nav { grid-column: auto; grid-row: auto; display: flex; flex-wrap: nowrap; gap: 8px; overflow: visible; }
.hud-nav button { position: relative; display: flex; flex: 0 0 60px; flex-direction: column; align-items: center; width: 60px; min-width: 0; min-height: 73px; padding: 2px 0 0; gap: 5px; border-radius: 18px; color: #fff9df; font: 800 12px/1.3 var(--game-type); }
.hud-nav button > span.nav-label { position: static; width: auto; height: auto; margin: 0; padding: 0; overflow: visible; clip: auto; white-space: nowrap; text-overflow: clip; text-shadow: -1px -1px #69421f, 1px -1px #69421f, -1px 1px #69421f, 1px 2px #69421f, 0 3px 3px #58401d66; }
.hud-nav button:nth-child(n) .nav-emblem { position: relative; display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border: 2px solid #deb371; border-radius: 50%; background: radial-gradient(ellipse at 40% 20%, #fff1cce8, #e7ba76ed 66%, #c28b46); box-shadow: inset 0 2px #fff7da, inset 0 -2px #b77d3c66, 0 3px 6px #4d462d40; transition: transform 180ms var(--game-ease), filter 180ms var(--game-ease); }
.hud-nav .nav-emblem img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 1px #6a49293d); }
.hud-nav button:hover .nav-emblem { transform: translateY(-3px) rotate(-3deg); filter: brightness(1.08); }
.hud-nav button:active { transform: translateY(1px) scale(.96); }
.nav-badge { position: absolute; z-index: 1; top: -6px; right: -7px; display: grid; place-items: center; min-width: 20px; height: 19px; padding: 0 5px; border: 1px solid #ffe9b3; border-radius: 999px; background: linear-gradient(#c97837, #a24725); color: #fff8da; box-shadow: 0 2px 4px #63401c4d; font: 800 10px/1 var(--hud-type); font-variant-numeric: tabular-nums; text-shadow: 0 1px #823e23; }
.nav-badge[hidden] { display: none; }
.topbar button:focus-visible { outline: 3px solid #fff7cf; outline-offset: 3px; }
@keyframes hud-focus-arrive { from { opacity: .65; transform: translateY(-4px); filter: blur(1px); } to { opacity: 1; transform: none; filter: none; } }
@media (max-width: 1240px) {
  .topbar { grid-template-columns: 422px minmax(0, 1fr) auto; padding-inline: 16px; gap: 16px; }
  .hud-home { grid-template-columns: 182px minmax(0, 1fr); gap: 10px; }
  .hud-home .farm-brand { font-size: 14px; }
  .hud-nav { gap: 4px; }
  .hud-nav button { width: 52px; flex-basis: 52px; }
  .task-strip .task-chip { font-size: 11px; }
}
@media (max-width: 1100px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .hud-home { max-width: 422px; grid-template-columns: minmax(135px, .8fr) minmax(185px, 1.2fr); }
  #task-strip { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: minmax(0, 1fr); padding: 12px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); gap: 9px; }
  .hud-home { width: 100%; max-width: none; grid-template-columns: minmax(98px, .8fr) minmax(0, 1.5fr); gap: 10px; }
  .hud-home .player { min-height: 54px; margin-left: 14px; padding: 4px 7px 4px 28px; }
  .hud-home .avatar { width: 48px; height: 48px; top: 0; left: -19px; }
  .hud-home .farm-brand { font-size: 13px; }
  .hud-home .level-chip { position: absolute; left: -12px; bottom: -4px; font-size: 9px; }
  .hud-home .wallet { gap: 5px; }
  .wallet .asset { min-height: 34px; padding: 2px 5px 2px 3px; gap: 2px; }
  .wallet .asset img { flex-basis: 23px; width: 23px; height: 23px; }
  .wallet .asset strong { font-size: 15px; }
  .wallet #production-progress { height: 23px; min-height: 23px; padding-inline: 5px; gap: 2px; }
  .wallet .meter-icon { display: none; }
  .wallet .meter-copy { font-size: 12px; gap: 2px; }
  .wallet .meter-divider { margin-inline: 1px; }
  .wallet .meter-gem { width: 10px; height: 10px; }
  .hud-nav { grid-column: 1; grid-row: 2; justify-content: space-between; gap: 0; }
  .hud-nav button { width: auto; flex: 1 1 0; min-height: 64px; gap: 4px; font: 700 12px/1.4 var(--hud-type); }
  .hud-nav button > span.nav-label { padding: 2px 3px; border-radius: 4px; background: #593d24; color: #fff9df; text-shadow: none; }
  .hud-nav button:nth-child(n) .nav-emblem { width: 42px; height: 42px; flex-basis: 42px; }
  .hud-nav .nav-emblem img { width: 38px; height: 38px; }
  .nav-badge { right: -5px; top: -5px; min-width: 18px; height: 17px; padding-inline: 4px; font-size: 9px; }
  #task-strip { grid-column: 1; grid-row: 3; gap: 6px; justify-content: center; }
  .task-strip .task-chip { height: 30px; min-height: 30px; padding: 3px 8px 3px 5px; gap: 3px; font-size: 10px; }
  .task-strip .task-icon { width: 17px; height: 17px; flex-basis: 17px; }
  .task-strip .task-icon .ui-icon { width: 14px; height: 14px; }
}
@media (max-width: 350px) {
  .topbar { padding-inline: 8px; gap: 8px; }
  .hud-home { gap: 6px; }
  .hud-home .farm-brand { font-size: 11px; }
  .wallet .asset strong { font-size: 13px; }
  .wallet .asset img { flex-basis: 20px; width: 20px; height: 20px; }
  .wallet .meter-rate { display: none; }
  .hud-nav button > span.nav-label { padding-inline: 1px; }
  #task-strip { column-gap: 4px; }
  .task-strip .task-chip { padding-inline: 5px; font-size: 9px; }
}
@media (max-height: 520px) and (min-width: 780px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding: 8px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); gap: 6px 16px; }
  .hud-home { max-width: 420px; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; }
  .hud-home .player { min-height: 46px; padding-left: 28px; }
  .hud-home .avatar { width: 46px; height: 46px; }
  .hud-home .farm-brand { font-size: 12px; }
  .hud-home .level-chip { font-size: 9px; }
  .wallet .asset { min-height: 30px; }
  .wallet .asset strong { font-size: 16px; }
  .wallet #production-progress { display: flex; min-height: 22px; height: 22px; }
  .wallet .meter-icon { display: none; }
  .wallet .meter-copy { font-size: 9px; }
  .hud-nav { grid-column: 2; grid-row: 1; }
  .hud-nav button { min-height: 58px; }
  .hud-nav button:nth-child(n) .nav-emblem { width: 38px; height: 38px; flex-basis: 38px; }
  .hud-nav .nav-emblem img { width: 35px; height: 35px; }
  #task-strip { grid-column: 1 / -1; grid-row: 2; }
  .task-strip .task-chip { min-height: 28px; height: 28px; font-size: 10px; }
}
/* A real cutout building: no ground tile, idle animation or extra paint loop. */
#buildings .building.has-layout-hit { pointer-events: none; }
.building-layout-hit { position: absolute; pointer-events: auto; min-width: 44px; min-height: 44px; }
#building-kitchen { transform-origin: 50% 95%; }
#building-kitchen > img { filter: none; }
#building-kitchen:focus-visible { outline: 3px solid #fff0b4; outline-offset: 3px; border-radius: 24px; }
.building-status { position: absolute; left: 50%; top: -5px; transform: translateX(-50%) scale(var(--scene-ui-scale, 1)); transform-origin: center bottom; white-space: nowrap; padding: 4px 10px; border: 1px solid #a7753e; border-radius: 14px; background: #fff0c6; color: #65431f; font: 750 12px/1.4 var(--game-type); box-shadow: 0 2px 4px #50351622; pointer-events: none; }
.kitchen-content { min-width: 0; }
[data-route="kitchen"] > .segmented { margin-block: 12px 18px; }
@media (prefers-reduced-motion: reduce) { #building-kitchen { transition: none; } #building-kitchen:hover { transform: none; } }

/* Shared stock stays findable from the warehouse and every production loop. */
.catalog-summary:has(.warehouse-shortcuts) { flex-wrap: wrap; }
.warehouse-shortcuts { display: flex; flex-basis: 100%; gap: 8px; padding-top: 2px; }
.warehouse-shortcuts > button { flex: 1; min-height: 38px; font-variant-numeric: tabular-nums; }
.hive-inventory { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; background: #e5edce; color: #40582c; }
.hive-inventory > strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.hive-inventory > button { margin-left: auto; }
.hive-pending { color: #4b5d2d; font-weight: 700; }
.hive-sweets { display: flex; align-items: center; gap: 10px; color: #79521e; }
.hive-sweets > .ui-item-art { width: 46px; height: 46px; }
.village-slot > .trade-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.village-slot .ui-stepper { width: 100%; min-width: 0; }
.village-slot > .ui-stepper { margin-top: 6px; }
.village-slot > .trade-actions > button { flex: 1; margin-top: 0; }
.voyage-inventory { display: flex; flex-wrap: wrap; gap: 6px; }
.voyage-inventory .chip { white-space: normal; line-height: 1.5; }
.all-plot-preparation { margin-bottom: 20px; padding: 12px 0; border-block: 1px solid #d8c49a; }
.all-plot-preparation > p { color: #485b31; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0 0 10px; }
.all-plot-preparation .panel-actions { margin: 0; }
.material-inventory { margin-top: 16px; }
.material-inventory .material-card--inventory { grid-template-columns: minmax(0,1fr) minmax(230px,300px); gap: 10px 24px; padding: 16px; }
.material-card--inventory > .material-head { grid-column: 1; grid-row: 1; }
.material-card--inventory .material-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.material-card--inventory .material-name .ui-price { display: inline-flex; }
.material-card--inventory > .material-description { grid-column: 1; grid-row: 2; }
.material-description > p { margin: 0; color: #655333; font-size: 12px; line-height: 1.65; }
.material-card--inventory > .trade-actions { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: 8px; }
.material-card--inventory > .trade-actions .ui-stepper { width: 100%; min-width: 0; }
.material-destinations { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.material-destinations > button { min-height: 38px; padding-block: 4px; }
.field-effect .field-float { width: 260px; margin-left: -130px; font-size: 14px; }
.cost-item { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
.cost-item .cost-icon { flex: 0 0 auto; }
.cost-item .cost-text { min-width: 0; overflow-wrap: anywhere; }
[data-route="wishTree"] .village-slots { grid-template-columns: minmax(0,640px); justify-content: center; }
[data-route="market"] .village-slots:not(.market-supplies) { grid-template-columns: repeat(2,minmax(0,1fr)); }
[data-route="market"] > .ui-section-title { margin-top: 24px; }
.all-soil-upgrade { align-items: center; gap: 12px; margin-bottom: 20px; }
.soil-upgrade-quote { color: #655333; font-variant-numeric: tabular-nums; font-size: 13px; }
.catalog-fill-plots { margin-top: 8px; min-height: 44px; }
.neighbor-head { flex-wrap: wrap; }
.neighbor-head > button { min-height: 40px; }
@media (max-width:720px) {
  .material-inventory .material-card--inventory { grid-template-columns: minmax(0,1fr); gap: 10px; padding: 14px; }
  .material-card--inventory > .material-head, .material-card--inventory > .material-description,
  .material-card--inventory > .trade-actions, .material-destinations { grid-column: 1; grid-row: auto; }
  .material-card--inventory > .trade-actions { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .material-card--inventory > .trade-actions > button { min-height: 42px; max-width: 134px; white-space: normal; }
  .hive-inventory { gap: 8px; padding: 12px; }
  .hive-inventory > strong { flex-basis: 100%; font-size: 13px; }
  .hive-inventory > button { margin-left: 0; width: 100%; }
  .warehouse-shortcuts { gap: 5px; }
  .warehouse-shortcuts > button { padding: 5px; font-size: 12px; }
}
@media (max-width:560px) {
  .village-banner { min-height: 82px; padding: 8px 10px; gap: 8px; }
  .village-banner .village-art { width: 56px; height: 64px; flex: 0 0 56px; }
  .village-banner .village-title { font-size: clamp(16px,4.6vw,19px); line-height: 1.4; white-space: nowrap; }
  [data-route="market"] .village-slots { grid-template-columns: minmax(0,1fr); }
  .neighbor-head .neighbor-name { flex-basis: 180px; }
  .neighbor-head > button { flex: 1 1 120px; }
  [data-route="hive"] .village-slots, [data-route="voyage"] .village-slots,
  [data-route="fairy"] .village-slots { grid-template-columns: minmax(0,1fr); }
  [data-route="hive"] .village-slot, [data-route="voyage"] .village-slot { padding: 16px; gap: 10px; }
  [data-route="hive"] .village-slot p, [data-route="voyage"] .village-slot p { font-size: 13px; }
  .all-plot-preparation .panel-actions > button { flex: 1 1 140px; }
}

/* A sunlit garden seal, carved honey oak and an apple-green enamel gauge. */
.connection-gate {
  --launch-ink: #61401e;
  --launch-honey: #d99c3c;
  position: fixed; inset: 0; z-index: 1000; isolation: isolate;
  display: grid; place-items: center; overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  color: var(--launch-ink); background: #fff3d7;
  background-image: radial-gradient(ellipse at 50% 35%, #fffdf3 0, #fff6df 40%, #f5dda9 100%);
}
.connection-gate[hidden] { display: none; }
.connection-gate::before, .connection-gate::after {
  content: ''; position: absolute; z-index: -1; width: 140vw; height: 55vh;
  border-radius: 50%; pointer-events: none;
}
.connection-gate::before {
  left: -50vw; bottom: -40vh; transform: rotate(8deg);
  background: #adbe7438; box-shadow: 0 -24px 60px #c9c38026;
}
.connection-gate::after { right: -55vw; bottom: -35vh; transform: rotate(-12deg); background: #b2bd7640; }
.gate-card { position: relative; width: min(440px, 100%); text-align: center; }
.gate-badge { position: relative; width: 324px; height: 300px; margin: 0 auto 10px; }
.gate-garden {
  position: absolute; width: 252px; height: 252px; left: 36px; top: 8px;
  border: 9px solid #f2cf83; border-radius: 50%;
  background: #a9cf6a url('assets/decorations/1.jpg') 32% 45% / 680px auto;
  box-shadow: inset 0 5px 16px #66511d50, 0 3px 0 2px #b47c33, 0 14px 30px #9b6d2830;
}
.gate-garden::after {
  content: ''; position: absolute; inset: -13px; border: 1px solid #d8b271; border-radius: inherit;
}
.gate-logo {
  position: absolute; left: 62px; top: 42px; width: 218px; height: 198px; object-fit: contain;
  filter: drop-shadow(0 12px 7px #4c491e50); transform-origin: 50% 90%;
  animation: gate-breathe 4s ease-in-out infinite;
}
.gate-wreath { position: absolute; inset: 0; width: 100%; height: 100%; color: #d5a34d; }
.gate-card h1 {
  position: relative; width: max-content; max-width: calc(100% + 12px); margin: -70px auto 32px;
  padding: 9px 34px 14px; border: 3px solid #efcc83; border-radius: 32% 32% 18% 18% / 16% 16% 24% 24%;
  background: linear-gradient(175deg, #b68542, #8e582b 65%, #74431f);
  box-shadow: inset 0 3px 2px #f1ce8e70, inset 0 -5px 5px #5e371d60, 0 5px 0 #794c27, 0 13px 22px #875d3033;
  color: #fff0bd; font: 800 52px/1.2 var(--game-type);
  text-shadow: 0 2px 0 #653913, 0 3px 3px #4e2c2070;
}
.gate-card h1::before, .gate-card h1::after {
  content: ''; position: absolute; top: 50%; width: 7px; height: 7px; border-radius: 50%;
  background: #f2c666; box-shadow: inset 0 1px 1px #fff3ba, 0 1px 2px #543416;
}
.gate-card h1::before { left: 13px; }
.gate-card h1::after { right: 13px; }
.gate-card p { min-height: 26px; margin: 0 0 16px; color: #72512d; font-size: 15px; line-height: 1.7; text-wrap: balance; }
.gate-progress {
  position: relative; height: 38px; padding: 5px; overflow: hidden;
  border-radius: 24px; border: 2px solid #b57b35;
  background: linear-gradient(#8d5b2d, #b58646);
  box-shadow: inset 0 3px 5px #53331670, 0 2px 0 #fff8e7, 0 7px 14px #a67c3030;
}
.gate-progress-track { position: relative; height: 100%; overflow: hidden; border-radius: 16px; background: #61421f; }
.gate-progress-fill {
  position: absolute; inset: 0; transform: scaleX(0); transform-origin: left;
  border-radius: inherit; overflow: hidden;
  background: linear-gradient(#d9f578 0, #9edb37 24%, #7fc62c 52%, #65ad24 80%, #a2d34a 100%);
  box-shadow: inset 0 2px 2px #f0ffd6, inset 0 -2px 3px #387b24;
}
.gate-progress-fill::after {
  content: ''; position: absolute; inset: 0 -80px;
  background: repeating-linear-gradient(115deg, #ffffff00 0 20px, #ffffff26 20px 38px, #ffffff00 38px 58px);
  animation: gate-shine 1.6s linear infinite;
}
.gate-progress-number {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff9dc; text-shadow: 0 1px 2px #3d441b, 1px 0 #3d441b, -1px 0 #3d441b;
  font: 20px/1 'FarmNumerals', var(--game-type); font-variant-numeric: tabular-nums;
}
.gate-seed { position: absolute; width: 28px; height: 28px; color: #a0b04c; animation: gate-drift 5s ease-in-out infinite; }
.gate-seed--one { left: -18px; top: 80px; transform: rotate(-30deg); }
.gate-seed--two { right: -12px; top: 3px; color: #d3a149; animation-delay: -2s; }
#gate-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 22px 0 0; }
#gate-actions:empty { display: none; }
#gate-actions a { text-decoration: none; }
#gate-actions .action-button { min-height: 46px; padding: 10px 22px; }
#gate-actions a:focus-visible, #gate-actions button:focus-visible { outline: 3px solid #4b741d; outline-offset: 5px; }
.connection-gate[data-state='error'] h1 { font-size: 30px; padding: 15px 32px; margin-bottom: 28px; }
.connection-gate[data-state='error'] .gate-logo, .connection-gate[data-state='error'] .gate-seed { animation-play-state: paused; }
.connection-gate[data-state='revealing'] { pointer-events: none; }
@keyframes gate-breathe { 50% { transform: translateY(-5px) rotate(-1deg); } }
@keyframes gate-shine { to { transform: translateX(58px); } }
@keyframes gate-drift { 50% { translate: 5px -9px; rotate: 12deg; } }
@media (max-width: 540px) {
  .connection-gate { padding-right: 26px; padding-left: 26px; }
  .gate-badge { width: 280px; height: 274px; }
  .gate-garden { width: 228px; height: 228px; left: 26px; top: 8px; background-size: 620px auto; }
  .gate-logo { left: 48px; top: 40px; width: 196px; height: 178px; }
  .gate-card h1 { margin-top: -62px; padding: 9px 28px 13px; font-size: 43px; }
  .gate-card p { font-size: 14px; margin-bottom: 15px; }
  .gate-seed--one { left: -9px; }
  .gate-seed--two { right: -3px; }
}
@media (max-height: 560px) and (min-width: 541px) {
  .gate-badge { zoom: .65; }
  .gate-card h1 { font-size: 35px; margin-top: -45px; margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .connection-gate *, .connection-gate *::after { animation: none !important; transition: none !important; }
}

