/* โครงการก่อสร้างเมือง (city-window.js) — กระดาษแบบป้ายข่าว (ui-herald.css) · ทอง/teal ประจำเกม
   คอม: กลางจอกว้าง 660 · จอสัมผัส: Screen Shell (ui-touch.css) เนื้อในปรับตามความกว้างจริงด้วย container query */
#windows .win[data-win="city"] { width: min(95vw, 660px); max-height: min(92vh, 860px); }
#windows .win[data-win="city"] > .body { max-height: min(84vh, 800px); overflow: auto; padding: 0; container-type: inline-size; }

.cy { --parch: #fbf3df; --ink: #4a3418; --muted: #8a6a3a; --line: #e3cf9f; --teal: #2f6f73; --gold: #e8b64a;
  display: flex; flex-direction: column; background: var(--parch); color: var(--ink); min-height: 100%; font-size: 13.5px; }
.cy-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: linear-gradient(180deg, #fff7e2, #f3e2b8); border-bottom: 2px solid #c99a4a; }
.cy-top b { display: block; font: 700 20px/1.15 var(--font-head); color: #5b3a10; }
.cy-top span { font-size: 12px; color: var(--muted); }
.cy-badge { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff8e6, #f0d79c); border: 2px solid var(--gold); }
.cy-badge img { width: 34px; height: 34px; object-fit: contain; }   /* ศาลาใต้นั่งร้าน (kit/win/build.webp · 57) */
.cy-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 12px 6px; border-bottom: 1px solid var(--line); }
.cy-tabs button { min-height: 36px; border-radius: 10px 10px 6px 6px; border: 1px solid #d8bd84; background: linear-gradient(#fffaf0, #f4e6c4);
  font: 600 13px var(--font-head); color: var(--ink); cursor: pointer; }
.cy-tabs button.on { background: linear-gradient(#3b8589, var(--teal)); color: #fff; border-color: #24585b; }
.cy-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; }

.cy-bar { display: block; height: 10px; border-radius: 6px; background: #ead9b0; overflow: hidden; box-shadow: inset 0 1px 2px #8a6a3a44; }
.cy-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #d9a440, var(--gold)); transition: width .6s ease; }
.cy-bar.ok i { background: linear-gradient(90deg, #3b8589, #4fa6a0); }
.cy-bar.big { height: 16px; border-radius: 9px; }

.cy-hero { background: #fffaf0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.cy-pct { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; }
.cy-pct > b { font: 700 30px/1 var(--font-head); color: #5b3a10; grid-row: span 2; }
.cy-steps { display: flex; justify-content: space-between; }
.cy-steps i { font-style: normal; font-size: 11px; color: #b49a6a; }
.cy-steps i.on { color: var(--teal); font-weight: 700; }
.cy-hero p { margin: 8px 0 4px; line-height: 1.45; }
.cy-hero small { color: var(--muted); }

.cy-list { display: flex; flex-direction: column; gap: 8px; }
.cy-res { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px;
  background: #fffaf0; border: 1px solid var(--line); border-radius: 10px; }
.cy-res.full { opacity: .78; }
.cy-ic { width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px; }
.cy-ic img { width: 38px; height: 38px; object-fit: contain; }
.cy-rt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cy-rt small { color: var(--muted); font-size: 11.5px; }
.cy-give { display: flex; align-items: center; gap: 4px; }
.cy-give button { min-width: 30px; min-height: 32px; border-radius: 8px; border: 1px solid #d0b071; background: #fff7e2; font-weight: 700; color: var(--ink); cursor: pointer; }
.cy-give .cy-all { padding: 0 8px; font-size: 12px; }
.cy-give input { width: 84px; min-height: 32px; border-radius: 8px; border: 1px solid #d0b071; background: #fff; text-align: right; padding: 0 6px; font: 600 13px var(--font-head); color: var(--ink); }

.cy-send { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #f4ead0; }
.cy-donate, .cy-go { min-height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid #24585b; cursor: pointer;
  background: linear-gradient(#3b8589, var(--teal)); color: #fff; font: 700 14px var(--font-head); align-self: flex-start; }
.cy-donate[disabled] { opacity: .45; cursor: default; }
.cy-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.cy-story summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.cy-story p { line-height: 1.5; margin: 6px 0 0; }
.cy-empty { padding: 20px; text-align: center; color: var(--muted); }

.cy-tiers { display: flex; flex-direction: column; gap: 8px; }
.cy-tier { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #fffaf0; border: 1px solid var(--line); }
.cy-tier.got { border-color: #4fa6a0; background: #f1f8f3; }
.cy-tier > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cy-tier small { color: var(--muted); font-size: 11.5px; }
.cy-tic { font-size: 26px; text-align: center; }
.cy-tic img { width: 40px; height: 40px; object-fit: contain; }
.cy-tst { font-size: 12px; color: var(--teal); font-weight: 600; }

.cy-plaque { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 14px; border-radius: 12px;
  background: linear-gradient(#d9ccae, #c9b892); border: 3px solid #a98d5c; box-shadow: inset 0 0 0 2px #e8b64a66; }
.cy-plaque span { font: 600 13px var(--font-head); color: #3f2d14; padding: 2px 8px; border-radius: 6px; background: #efe5cc; }

/* แคบ (มือถือแนวนอนในกรอบเต็ม · คอมจอเล็ก): ช่องบริจาคลงแถวล่าง */
@container (max-width: 520px) {
  .cy-res { grid-template-columns: 36px 1fr; }
  .cy-give { grid-column: 1 / -1; justify-content: flex-end; }
  .cy-send { flex-direction: column; align-items: stretch; }
}
html.touch-ui .cy-give button, html.touch-ui .cy-tabs button { min-height: 40px; }

/* ไซต์ก่อสร้างหน้าด่าน (ใบ 163): แท็บที่ 4 · แถวไซต์ · ป้าย % เหนือหัว Hobb ในโลก */
.cy-tabs.t4 { grid-template-columns: repeat(4, 1fr); }
.cy-site.mine { border-color: #4fa6a0; background: #f1f8f3; }
.cy-site .cy-tst { font-size: 11.5px; font-weight: 700; color: var(--teal); white-space: nowrap; }
.cy-h { margin: 4px 0 0; font: 700 15px var(--font-head); color: #5b3a10; }
.cy-h small { font: 600 12px var(--font-head); color: var(--muted); margin-left: 6px; }
.label .cy-wtag { display: block; width: max-content; margin: 2px auto 0; padding: 1px 8px; border-radius: 9px; font-size: 12px; font-weight: 700; line-height: 1.35;
  color: #4a3418; background: #fbf3dfee; border: 1px solid #e8b64a; }
.label .cy-wtag.done { color: #fff; background: #2f6f73ee; border-color: #24585b; }

/* ประตู Hobb รอบรีเซ็ต (ใบ 182 · สวิตช์ล็อกเปิดเท่านั้น): เพดานวันนี้ · Gold → แต้ม · ป้ายหอ · รางวัลส่วนตัว */
.cy-cap { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; background: #fffaf0; border: 1px solid var(--line); }
.cy-cap b { font: 700 13px var(--font-head); color: #5b3a10; }
.cy-cap small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.cy-cap.full { background: #f1f8f3; border-color: #4fa6a0; }
.cy-cap.fish { box-shadow: inset 0 0 0 2px #6bc7cc; }
.cy-gold .cy-ic { font-size: 24px; }
.cy-gp { min-width: 24px; text-align: center; font: 700 14px var(--font-head); color: var(--ink); }
.cy-give .cy-gbtn { min-height: 32px; padding: 0 10px; font-size: 12px; }
.cy-perk { background: #fbf3df; border-radius: 10px; padding: 6px 10px; }
.cy-site .cy-tst { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cy-plq { min-height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid #d0b071; background: #fff7e2; font: 600 11.5px var(--font-head); color: #5b3a10; cursor: pointer; }
.cy-board { background: #fffaf0; border: 1px solid #e8b64a; border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.cy-board .cy-h { display: flex; align-items: center; justify-content: space-between; }
.cy-x { min-width: 32px; min-height: 32px; border-radius: 8px; border: 1px solid #d0b071; background: #fff7e2; cursor: pointer; }
.cy-top10 { margin: 0; padding-left: 22px; display: grid; gap: 2px; }
.cy-top10 li { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.cy-top10 li span { color: var(--muted); }
.cy-board small { color: var(--muted); font-size: 11.5px; }
.cy-club { margin: 0; font-size: 12px; line-height: 1.5; word-break: break-word; }
html.touch-ui .cy-plq, html.touch-ui .cy-x { min-height: 40px; }
