/* 常驻 HUD · 右上 C 区（界面规范第五节）：208×160 之内放 钱 / 菜单 / 营造 / 三枚小功能键 / 圆形小地图。
   布局：第一行 钱 · 菜单 · 营造；第二块 左边三枚对齐的小圆键（设置/暂停/指南）竖排，右边圆形小地图。
   旧样式叠了十来层 !important，这里用更高的选择器一次性收口；其余界面不受影响。 */
html body #hud #hud-tr#hud-tr[data-ui][class] {
  position: absolute !important; top: max(8px, env(safe-area-inset-top, 0px)) !important; right: max(10px, env(safe-area-inset-right, 0px)) !important;
  width: 208px !important; height: auto !important; max-height: 160px;
  display: grid !important; grid-template-columns: 60px 36px 50px 50px !important; grid-template-rows: 36px 4px 32px 32px 32px !important;
  gap: 4px !important; align-items: center !important; justify-items: stretch !important; flex-direction: unset !important;
  scale: var(--hud-scale, 1) !important; transform: none !important; transform-origin: right top !important; padding: 0 !important; margin: 0 !important;
}
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-strip, html body #hud #hud-tr#hud-tr[data-ui][class] .tr-map, html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock { display: contents !important; }
/* 第一行：钱 · 菜单 · 营造 */
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-strip > .coin { grid-column: 1 / 3; grid-row: 1; min-width: 0 !important; width: 100% !important; height: 32px; min-height: 0 !important; margin: 0 !important; padding: 0 6px 0 3px !important; justify-content: flex-start !important; overflow: hidden; box-sizing: border-box; }
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-strip > .coin b { font-size: 13px !important; letter-spacing: 0 !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
html body #hud #hud-tr#hud-tr[data-ui][class] #btn-hudmenu, html body #hud #hud-tr#hud-tr[data-ui][class] .tr-strip > #btn-deed { grid-row: 1; align-self: center; justify-self: stretch; width: 100% !important; min-width: 0; height: 34px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center; font-family: "猫田楷", "Noto Serif SC", serif; font-size: 15px; letter-spacing: 2px; line-height: 1; white-space: nowrap; color: #23292a; box-sizing: border-box;
  border-width: 7px; border-image: url(../../assets/ui/ink/frame_thin.webp) 30 / 7px / 0 stretch; box-shadow: 0 3px 6px rgba(18,26,22,.3), inset 0 0 0 1px rgba(181,154,98,.5); }
html body #hud #hud-tr#hud-tr[data-ui][class] #btn-hudmenu { grid-column: 3; }
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-strip > #btn-deed { grid-column: 4; }
html body #hud #hud-tr#hud-tr[data-ui][class] #btn-hudmenu:active, html body #hud #hud-tr#hud-tr[data-ui][class] .tr-strip > #btn-deed:active { transform: translateY(1px); }
html body #hud #hud-tr#hud-tr[data-ui][class] #btn-hudmenu.dot::after { content: ""; width: 6px; height: 6px; margin-left: 2px; border-radius: 50%; background: #a8392b; }
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-strip > #btn-deed svg { display: none; }
/* 左下：三枚小圆键竖排对齐（设置 / 暂停 / 指南），挨着圆形小地图 */
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > button { grid-column: 2; width: 32px !important; height: 32px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; flex: none !important; justify-self: center; align-self: center; position: relative; }
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > button::after { content: ""; position: absolute; top: -4px; right: -4px; bottom: -4px; left: -4px; }       /* 点按区补到 40×40 */
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > #btn-set { grid-row: 3; display: grid !important; }
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > #btn-pause220 { grid-row: 4; display: grid !important; }
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > #btn-guide181 { grid-row: 5; display: grid !important; }
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > #btn-mm, html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > #mm-shape { display: none !important; }
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > button { color: #2a2620 !important; font-size: 0 !important; }
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > button svg { display: block; width: 18px !important; height: 18px !important; margin: 0 auto; }
/* 三个图标：同一大小、同一线宽、同一墨色（原来一个是文字符号，两个是不同画板的 SVG） */
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > button svg path, html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > button svg rect, html body #hud #hud-tr#hud-tr[data-ui][class] .tr-dock > button svg circle:not([stroke="none"]) { stroke: #2a2620 !important; stroke-width: 1.6px !important; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
/* 右：圆形小地图 */
html body #hud #hud-tr#hud-tr[data-ui][class] #minimap-wrap { grid-column: 3 / 5; grid-row: 3 / 6; justify-self: end; align-self: start; width: 104px !important; height: 104px !important; margin: 0 !important; box-sizing: border-box; }
html body #hud #hud-tr#hud-tr[data-ui][class] #minimap-wrap #minimap { width: 100% !important; height: 100% !important; }
/* 旧的文字入口：收进菜单，不再摆在屏幕上（点击事件还是它们自己的） */
html body #hud #hud-tr#hud-tr[data-ui][class] .tr-strip > button:not(#btn-deed), html body #hud #hud-tr#hud-tr[data-ui][class] .tr-hidden, html body #hud #hud-tr#hud-tr[data-ui][class] .tr-hidden > * { position: absolute !important; left: -9999px !important; top: 0 !important; width: 1px !important; height: 1px !important; overflow: hidden !important; pointer-events: none !important; opacity: 0 !important; }
/* 菜单展开：沿用游戏里二级面板的宣纸 + 墨框 + 猫田楷（和 #choice / .pbox 同一套），向左下展开，不盖小地图 */
#hud-menu-pop { position: fixed; z-index: 31; display: none; grid-template-columns: repeat(2, 80px); gap: 6px; padding: 2px 0 4px; pointer-events: auto;
  font-family: "猫田楷", "Noto Serif SC", serif; color: #23292a;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,250,235,.55), rgba(0,0,0,0) 70%), url(../../assets/ui/ink/paper.webp) repeat, #d9ccaa; border: 10px solid transparent; border-image: url(../../assets/ui/ink/frame_thin.webp) 30 / 10px / 0 stretch;
  box-shadow: 0 6px 16px rgba(18,26,22,.30), 0 1px 0 rgba(18,26,22,.18); }
#hud-menu-pop.on { display: grid; animation: hudpop .22s cubic-bezier(.2,.7,.2,1); }
@keyframes hudpop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
#hud-menu-pop button { position: relative; height: 34px; display: flex; align-items: center; justify-content: flex-start; gap: 5px; padding: 0 4px 0 4px; font-family: inherit; font-size: 14px; letter-spacing: 2px; line-height: 1; white-space: nowrap; color: #23292a;
  background: url(../../assets/ui/ink/paper.webp) repeat, #fbf6e6; border: 1px solid #6b5a42; border-radius: 4px; box-shadow: 0 2px 0 #8a7650, 0 3px 5px rgba(18,26,22,.25), inset 0 0 0 2px rgba(255,255,255,.45), inset 0 -10px 12px -8px rgba(107,90,66,.28); }
#hud-menu-pop button::after { content: ""; position: absolute; left: 30px; right: 6px; bottom: 5px; height: 3px; background: url(../../assets/ui/ink/ink_line.webp) center / 100% 100% no-repeat; opacity: .5; }
#hud-menu-pop button:hover { border-color: #3f6a4c; }
#hud-menu-pop button:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a7650, inset 0 0 0 2px rgba(255,255,255,.35), inset 0 6px 10px -4px rgba(107,90,66,.4); }
#hud-menu-pop .seal { flex: none; width: 22px; height: 22px; display: grid; place-items: center; font-size: 14px; letter-spacing: 0; color: #f5efdc; background: #a8392b; border: 1px solid #7c2a20; border-radius: 3px; box-shadow: inset 0 0 0 2px rgba(245,239,220,.28), 1px 1px 0 rgba(42,38,32,.3); transform: rotate(-4deg); }
#hud-menu-pop .lab { position: relative; z-index: 1; }
#hud-menu-pop button svg { display: none; }
body.solo26 #btn-hudmenu, body.solo26 #hud-menu-pop, body.sun27 #btn-hudmenu, body.sun27 #hud-menu-pop { display: none !important; }
body.in-mine #hud #hud-tr #minimap-wrap { display: none !important; }

body.solo26 #hud #hud-tr .tr-strip > #btn-deed { display: none !important; }
/* 小游戏 / 小空间：只留小地图和三枚小圆键，其余入口整条收起（和原来一致） */
body.solo26 #hud #hud-tr#hud-tr[data-ui][class] .tr-strip { display: none !important; }
body.solo26 #hud #hud-tr#hud-tr[data-ui][class] .tr-dock { display: contents !important; }
