@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:wght@700;800;900&display=swap');
/* Crosspatch HUD, LOOK.md v3: rounded cream panels with wooden borders over the open farm. */
:root {
  --grass: #7CC243; --grass-l: #9AD45A; --grass-d: #5FA232; --soil: #A8743F; --path: #E3C98E; --water: #4FB3E8;
  --wood: #C98A4B; --wood-d: #8F5A2B; --roof: #D9483B; --roof-b: #3F7FCF; --stone: #B9B2A6; --cream: #FFF6E0; --cream-d: #F3E2BD;
  --ink: #3A2615; --shadow: #2B3A12; --coin: #FFC928; --coin-r: #E09A00; --xp: #5BC0F0; --star: #FF8A3D;
  --good: #3FB54E; --good-d: #2A7F36; --warn: #FF9F1C; --bad: #E5484D; --bad-d: #A8292D; --withered: #A08E5C;
  --font: "Baloo 2", "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif;
  --drop: 0 4px 10px rgba(43, 58, 18, 0.28);
  --top: 60px;
  /* round-2 names town.css still reads */
  --paper: var(--cream); --label: #FFFDF5; --teal: var(--good); --tomato: var(--bad); --mustard: var(--coin); --faint: rgba(58, 38, 21, 0.4); --serif: var(--font);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden; background: var(--grass); color: var(--ink);
  font-family: var(--font); font-size: 15px; font-weight: 600; line-height: 1.2; overscroll-behavior: none;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
.hide { display: none !important; }
canvas { display: block; }

/* the farm under the HUD (lane 3 owns the markup; these keep it full screen) */
#app { position: fixed; inset: 0; }
#field { position: fixed; inset: 0; }
#board { position: absolute; left: 0; top: 0; touch-action: none; }
#fx { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 40; }

/* building blocks */
.panel { background: var(--cream); border: 3px solid var(--wood-d); border-radius: 14px; box-shadow: var(--drop); }
.pill { background: var(--cream); border: 3px solid var(--wood-d); border-radius: 999px; box-shadow: var(--drop); }
i.ci { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: var(--coin); border: 2px solid var(--coin-r); margin-right: 3px; vertical-align: -1px; font-style: normal; flex: none; }
.rb {
  position: relative; width: 48px; height: 48px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--cream); border: 3px solid var(--wood-d); border-radius: 50%; box-shadow: 0 4px 0 var(--wood-d), var(--drop);
}
.rb.sm { width: 44px; height: 44px; }
.rb.x { background: var(--bad); border-color: var(--bad-d); box-shadow: 0 4px 0 var(--bad-d); }
.fat {
  position: relative; min-height: 48px; min-width: 48px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 800; font-size: 16px; line-height: 1.05; text-align: center; white-space: nowrap;
  background: var(--cream); border: 3px solid var(--wood-d); border-radius: 14px; box-shadow: 0 4px 0 var(--wood-d);
}
.fat.go { background: var(--good); border-color: var(--good-d); box-shadow: 0 4px 0 var(--good-d); color: #fff; text-shadow: 0 1.5px 0 var(--good-d); }
.fat.bad { background: var(--bad); border-color: var(--bad-d); box-shadow: 0 4px 0 var(--bad-d); color: #fff; }
.fat.off, .fat.go.off { background: #E4D6B8; border-color: #B49C72; box-shadow: 0 4px 0 #B49C72; color: rgba(58, 38, 21, 0.62); text-shadow: none; }
.fat.wide { width: 100%; }
.rb:active, .fat:active, .tool:active .tb, .tab:active, .sd:active, .nb:active .fc, #quest:active, .fslot:active {
  transform: translateY(2px) scale(0.95);
}
.rb:active, .fat:active { box-shadow: 0 1px 0 var(--wood-d); }
.fat.go:active { box-shadow: 0 1px 0 var(--good-d); }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; display: none;
  background: var(--bad); color: #fff; border: 2.5px solid var(--cream); box-shadow: 0 0 0 2px var(--bad-d);
  font: 800 13px/19px var(--font); font-style: normal; text-align: center; pointer-events: none;
}
.badge.on { display: block; }

/* ---------- HUD: everything floats over the farm; the gaps let taps through ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
#hud > * { pointer-events: auto; }
#topbar { position: absolute; left: 0; right: 0; top: env(safe-area-inset-top); height: var(--top); display: flex; align-items: flex-start; justify-content: space-between; padding: 8px 8px 0; pointer-events: none; }
#topbar > * { pointer-events: auto; }
#stats { display: flex; align-items: center; gap: 6px; min-width: 0; }
#level { position: relative; z-index: 2; width: 46px; height: 46px; flex: none; filter: drop-shadow(0 3px 3px rgba(43, 58, 18, 0.3)); }
#level b { position: absolute; inset: 4px 0 0; display: flex; align-items: center; justify-content: center; font: 800 18px/1 var(--font); color: #fff; text-shadow: -1.5px 0 var(--ink), 1.5px 0 var(--ink), 0 -1.5px var(--ink), 0 1.5px var(--ink), 0 2.5px var(--ink); }
#xp { position: relative; height: 32px; width: 104px; margin-left: -20px; padding: 0 6px 0 18px; display: flex; align-items: center; }
#xpbar { position: relative; flex: 1; height: 16px; border-radius: 8px; background: var(--cream-d); border: 2px solid var(--wood-d); overflow: hidden; }
#xpfill { display: block; height: 100%; width: 0; background: var(--xp); border-right: 2px solid #2E8CC0; }
#xpNum { position: absolute; left: 18px; right: 6px; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font: 800 13px/1 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; text-shadow: 0 0 3px var(--cream), 0 0 2px var(--cream); }
#coins { height: 38px; padding: 0 12px 0 5px; display: flex; align-items: center; gap: 4px; min-width: 88px; }
#coins b { font: 800 19px/1 var(--font); font-variant-numeric: tabular-nums; }
#coins.flash { background: #FFD4D4; border-color: var(--bad); }
#topR { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#topR .lk { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); font: 800 13px/16px var(--font); padding: 0 5px; background: var(--cream); border: 2px solid var(--wood-d); border-radius: 8px; white-space: nowrap; }
#bOrders.locked canvas, #t-plow.locked canvas { opacity: 0.5; }

#quest, #visitStrip { position: absolute; left: 8px; top: calc(env(safe-area-inset-top) + 64px); max-width: calc(100% - 76px); min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 2px 12px; font-size: 14px; font-weight: 700; text-align: left; }
#questText { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#questProg { flex: none; font: 800 14px/1 var(--font); font-variant-numeric: tabular-nums; display: flex; align-items: center; padding: 3px 8px; border-radius: 10px; background: var(--cream-d); }
#quest.done { background: var(--coin); border-color: var(--coin-r); }
#quest.done #questProg { background: var(--cream); }
#visitStrip { padding: 3px 3px 3px 14px; background: var(--coin); border-color: var(--coin-r); }
#visitText { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#visitStrip .fat { min-height: 44px; padding: 0 12px; font-size: 15px; }

/* tool column, bottom right */
#tools { position: absolute; right: 6px; bottom: calc(env(safe-area-inset-bottom) + 8px); display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none; }
.tool { position: relative; width: 64px; display: flex; flex-direction: column; align-items: center; pointer-events: auto; }
.tool .tb { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; background: var(--cream); border: 3px solid var(--wood-d); border-radius: 50%; box-shadow: 0 4px 0 var(--wood-d), var(--drop); }
.tool .tl { margin-top: -9px; z-index: 1; padding: 0 6px; font: 800 13px/16px var(--font); background: var(--cream); border: 2px solid var(--wood-d); border-radius: 8px; white-space: nowrap; }
.tool .badge { top: -4px; right: 2px; }
.tool.on .tb { background: var(--coin); border-color: var(--coin-r); box-shadow: 0 4px 0 var(--coin-r), 0 0 0 4px rgba(255, 246, 224, 0.9), var(--drop); }
.tool.on .tl { background: var(--coin); border-color: var(--coin-r); }
.tool.flash .tb { background: #FFD4D4; border-color: var(--bad); }
body.visiting #t-plow, body.visiting #t-market, body.visiting #t-edit, body.visiting #t-gifts, body.visiting #bOrders, body.visiting #bAlm, body.visiting #quest { display: none; }

/* bottom action bar (tool hints, placement, edit) */
#bar { position: absolute; left: 8px; right: 80px; bottom: calc(env(safe-area-inset-bottom) + 10px); min-height: 60px; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 8px; }
#bar canvas { flex: none; }
#bar .bt { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.15; }
#bar .fat { padding: 0 10px; font-size: 15px; min-height: 44px; }
#bar .bb { display: flex; gap: 6px; flex: none; }
#bar.stack { flex-wrap: wrap; padding: 6px 8px 8px; }
#bar.stack .bt { flex: 1 1 0; }
#bar.stack .bb { flex: 1 1 100%; }
#bar.stack .bb .fat { flex: 1 1 0; }

/* drawers that slide up: seeds, neighbours */
#seeds, #nbar { position: absolute; left: 6px; right: 6px; bottom: calc(env(safe-area-inset-bottom) + 6px); z-index: 3; padding: 0 0 8px; overflow: hidden; }
#nbar { right: 78px; }
.dh, #nbHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 12px; background: var(--wood); border-bottom: 3px solid var(--wood-d); }
.dh b, #nbHead b { font: 800 17px/1 var(--font); color: #fff; text-shadow: 0 2px 0 var(--wood-d), -1px 0 var(--wood-d), 1px 0 var(--wood-d); }
#seedScroll, #nbScroll { overflow-x: auto; overflow-y: hidden; touch-action: pan-x; scrollbar-width: none; }
#seedScroll::-webkit-scrollbar, #nbScroll::-webkit-scrollbar { display: none; }
#seedList, #nbList { display: flex; gap: 8px; padding: 10px 10px 4px; width: max-content; }
.sd { position: relative; width: 92px; min-height: 124px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; background: #FFFDF5; border: 2.5px solid var(--wood-d); border-radius: 12px; box-shadow: 0 3px 0 var(--wood-d); }
.sd .nm { font: 800 14px/1.05 var(--font); text-align: center; min-height: 30px; display: flex; align-items: center; }
.sd .pr { font: 700 13px/1.1 var(--font); white-space: nowrap; font-variant-numeric: tabular-nums; display: flex; align-items: center; }
.sd.sel { background: var(--coin); border-color: var(--coin-r); box-shadow: 0 3px 0 var(--coin-r); }
.sd.lock { background: var(--cream-d); }
.sd.lock > canvas:first-child { opacity: 0.4; }
.sd.lock > canvas:last-child { position: absolute; top: 6px; right: 6px; }
.sd.poor .pr { color: var(--bad); }
.nb { width: 66px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nb .fc { position: relative; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--grass-l); border: 3px solid var(--wood-d); box-shadow: 0 3px 0 var(--wood-d); }
.nb.add .fc { background: var(--good); border-color: var(--good-d); box-shadow: 0 3px 0 var(--good-d); }
.nb .lv { position: absolute; bottom: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; background: var(--star); color: #fff; border: 2px solid var(--ink); font: 800 13px/18px var(--font); text-align: center; }
.nb .nm { max-width: 66px; font: 800 13px/1.1 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbe { align-self: center; max-width: 180px; font-size: 14px; font-weight: 700; }

/* ---------- sheets ---------- */
#sheet {
  position: absolute; left: 0; right: 0; margin: 0 auto; width: calc(100% - 16px); max-width: 520px;
  top: calc(env(safe-area-inset-top) + var(--top)); bottom: calc(env(safe-area-inset-bottom) + 8px); z-index: 5;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--cream); border: 3px solid var(--wood-d); border-radius: 16px; box-shadow: 0 8px 24px rgba(43, 58, 18, 0.4);
}
.sheethead { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 58px; padding: 4px 6px 4px 14px; background: var(--wood); border-bottom: 3px solid var(--wood-d); }
.sheethead h2 { flex: 1; min-width: 0; font: 800 23px/1.1 var(--font); color: #fff; text-shadow: 0 2px 0 var(--wood-d), -1.5px 0 var(--wood-d), 1.5px 0 var(--wood-d), 0 -1.5px var(--wood-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.sheethead h2 small { font: 800 15px/1 var(--font); color: var(--ink); text-shadow: none; padding: 4px 9px; background: var(--cream); border: 2px solid var(--wood-d); border-radius: 10px; display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
#sheetTabs { flex: none; display: flex; gap: 5px; padding: 8px 8px 6px; background: var(--cream-d); border-bottom: 2px solid rgba(143, 90, 43, 0.35); }
.tab { flex: 1 1 0; min-width: 0; min-height: 52px; padding: 3px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: #FFFDF5; border: 2.5px solid var(--wood-d); border-radius: 12px; box-shadow: 0 3px 0 var(--wood-d); font: 800 13px/1 var(--font); }
.tab span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.4px; }
.tab.on { background: var(--coin); border-color: var(--coin-r); box-shadow: 0 3px 0 var(--coin-r); }
#sheetBody { flex: 1; overflow-y: auto; touch-action: pan-y; padding: 10px 10px 24px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.grow { flex: 1; min-width: 0; }
.empty { font-size: 15px; font-weight: 700; text-align: center; padding: 18px 8px; }
.lead { font-size: 14px; font-weight: 700; margin: 0 2px 8px; }
.note { font-size: 14px; font-weight: 700; margin: 2px 2px 8px; }

/* item cards: market, gift box, craft */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 440px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid.two { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ic { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 5px 7px; background: #FFFDF5; border: 2.5px solid var(--wood-d); border-radius: 12px; box-shadow: 0 3px 0 rgba(143, 90, 43, 0.55); text-align: center; }
.ic .pic { position: relative; width: 100%; display: flex; justify-content: center; padding: 2px 0; border-radius: 9px; background: #E8F4D4; }
.ic .tag { position: absolute; top: -3px; right: -3px; padding: 0 5px; font: 800 13px/18px var(--font); background: var(--cream); border: 2px solid var(--wood-d); border-radius: 8px; white-space: nowrap; }
.ic .lockpill { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 0 6px 0 3px; font: 800 13px/20px var(--font); background: var(--cream); border: 2px solid var(--wood-d); border-radius: 10px; white-space: nowrap; }
.ic.lock .pic { background: var(--cream-d); }
.ic.lock .pic > canvas:first-child { opacity: 0.4; filter: grayscale(0.6); }
.ic .nm { font: 800 14px/1.05 var(--font); min-height: 30px; display: flex; align-items: center; justify-content: center; }
.ic .ln { font-size: 13px; font-weight: 600; line-height: 1.12; color: #6A4E31; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ic .pr { margin-top: auto; display: flex; align-items: center; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ic .pr.poor b { color: var(--bad); }
.ic .fat { width: 100%; margin-top: 3px; padding: 0 4px; font-size: 15px; }
.ic.rec .ins { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; }
.ic.rec .in { display: inline-flex; align-items: center; gap: 1px; font: 800 13px/1 var(--font); font-variant-numeric: tabular-nums; }
.ic.rec .in.short b { color: var(--bad); }
.expand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px; text-align: center; }
.expand .nm { font: 800 22px/1.1 var(--font); }
.expand .ln { font-size: 15px; }
.expand .pr { font-size: 20px; font-weight: 800; display: flex; align-items: center; }
.expand .pr.poor b { color: var(--bad); }
.expand .fat { min-width: 160px; }
.postb { margin-bottom: 12px; justify-content: flex-start; }
.postb .badge { position: static; margin-left: auto; box-shadow: none; }
.bjob { display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin-bottom: 12px; font-size: 15px; box-shadow: none; }
.bjob:not(.idle) { background: var(--coin); border-color: var(--coin-r); }
.bjob.idle { border-style: dashed; font-weight: 700; }

/* orders, almanac, ribbons, finds */
.ord { display: flex; gap: 10px; align-items: center; padding: 10px; margin: 0 0 12px; box-shadow: none; }
.ord .who { font: 800 16px/1.1 var(--font); }
.ord .want { font-size: 14px; display: flex; align-items: center; gap: 4px; }
.ord .bar, .ent .bar { height: 14px; border: 2px solid var(--wood-d); border-radius: 7px; margin: 5px 0; background: var(--cream-d); overflow: hidden; }
.ord .bar i, .ent .bar i { display: block; height: 100%; background: var(--good); }
.ord .rw { font-size: 13px; font-variant-numeric: tabular-nums; }
.ord .acts { display: flex; flex-direction: column; gap: 8px; flex: none; }
.ord .acts .fat { min-width: 76px; font-size: 15px; }
.ord.wait { justify-content: center; font-weight: 700; min-height: 72px; border-style: dashed; }
.ent { display: flex; gap: 10px; padding: 8px 10px; margin-bottom: 8px; align-items: center; box-shadow: none; border-width: 2px; }
.ent canvas { flex: none; }
.ent .no { font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0.7; }
.ent .nm { font: 800 17px/1.1 var(--font); }
.ent .ln { font-size: 13px; line-height: 1.2; }
.ent .st { font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ent .fb { font-size: 13px; margin-top: 2px; font-weight: 800; color: var(--good-d); }
.ent.blank { background: var(--cream-d); }
.ent.blank .slot { width: 56px; height: 56px; border: 2.5px dashed var(--wood-d); border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; font: 800 26px/1 var(--font); }
.ent .sil { position: relative; flex: none; }
.ent .sil b, .fslot .q { position: absolute; right: -2px; bottom: -2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--cream); border: 2px solid var(--wood-d); font: 800 13px/16px var(--font); text-align: center; }
.stamp { display: inline-block; margin-left: 6px; padding: 0 6px; font: 800 13px/18px var(--font); border: 2px solid var(--ink); border-radius: 8px; vertical-align: 2px; }
.stamp.bred, .stamp.in { background: var(--good); color: #fff; }
.stamp.grown { background: var(--coin); }
.stamp.c1 { background: var(--coin); } .stamp.c2 { background: #fff; } .stamp.c3 { background: var(--bad); color: #fff; } .stamp.c4 { background: var(--roof-b); color: #fff; }
.stamp.in { margin-left: 0; }
.pack { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.pack .fat { min-height: 44px; padding: 0 10px; font-size: 14px; }
.pack .have { font-size: 13px; font-weight: 700; }
.tierh { margin: 14px 2px 6px; font: 800 15px/1 var(--font); color: var(--wood-d); }
.note.ms, .ent .ms { display: flex; align-items: center; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ent .ms { margin-top: 3px; }
.setb { padding: 10px; margin-bottom: 10px; box-shadow: none; border-width: 2px; }
.setb.done { background: #E8F4D4; }
.setb .sh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.setb .sh b { font: 800 17px/1.1 var(--font); }
.setb .sh span { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.setb .ln { font-size: 13px; line-height: 1.2; }
.setb .fat { margin-top: 10px; font-size: 14px; white-space: normal; }
.slots { display: flex; gap: 8px; margin-top: 8px; }
.fslot { position: relative; flex: 1; max-width: 60px; aspect-ratio: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; border: 2.5px dashed var(--wood-d); border-radius: 12px; cursor: pointer; }
.fslot.got { background: #FFFDF5; border-style: solid; box-shadow: 0 3px 0 rgba(143, 90, 43, 0.55); }
.fslot.was { border-style: dashed; box-shadow: none; }
.fslot em { position: absolute; top: -8px; right: -7px; min-width: 22px; height: 20px; border-radius: 10px; background: var(--coin); border: 2px solid var(--ink); font: 800 13px/16px var(--font); font-style: normal; text-align: center; padding: 0 3px; }

/* settings menu */
#menuPop { position: fixed; z-index: 52; display: flex; flex-direction: column; padding: 4px; min-width: 220px; }
#menuPop .row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-bottom: 2px solid var(--cream-d); font-size: 16px; font-weight: 800; text-align: left; }
#menuPop .row:last-child { border-bottom: none; }

/* overlays */
#tip { position: fixed; z-index: 47; padding: 8px 14px; font-size: 15px; font-weight: 800; max-width: min(300px, calc(100vw - 96px)); text-align: center; pointer-events: none; background: var(--coin); border-color: var(--coin-r); border-radius: 16px; }
#hand { position: fixed; left: 0; top: 0; z-index: 48; pointer-events: none; }
#bubble { position: fixed; left: 0; top: 0; z-index: 45; padding: 7px 12px; font-size: 14px; font-weight: 700; max-width: 230px; pointer-events: none; border-radius: 16px; }
#toast { position: fixed; z-index: 46; padding: 8px 16px; width: max-content; max-width: min(320px, calc(100vw - 32px)); font-size: 15px; font-weight: 800; pointer-events: none; text-align: center; border-radius: 16px; }
#banner { position: fixed; z-index: 44; left: 50%; top: calc(env(safe-area-inset-top) + 110px); display: flex; flex-direction: column; align-items: center; padding: 6px 18px; text-align: center; pointer-events: none; background: var(--coin); border-color: var(--coin-r); border-radius: 16px; }
#banner b { font: 800 18px/1.1 var(--font); white-space: nowrap; }
#banner b i { display: inline-block; width: 12px; height: 12px; margin: 0 2px; border: 2px solid var(--coin-r); border-radius: 50%; background: var(--cream); vertical-align: -1px; }
#banner span { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
#lvlup { position: fixed; z-index: 49; left: 50%; top: 42%; display: flex; align-items: center; gap: 10px; padding: 10px 22px 10px 12px; pointer-events: none;
  background: var(--cream); border: 4px solid var(--wood-d); border-radius: 22px; box-shadow: 0 6px 0 var(--wood-d), 0 10px 30px rgba(43, 58, 18, 0.45); }
#lvlup .lt { display: flex; flex-direction: column; align-items: flex-start; }
#lvlup small { font: 800 15px/1 var(--font); letter-spacing: 1.5px; color: var(--star); }
#lvlup b { font: 800 34px/1.05 var(--font); white-space: nowrap; }
#lvlupList { display: flex; gap: 4px; margin-top: 2px; }
#cardWrap { position: fixed; inset: 0; z-index: 50; background: rgba(43, 58, 18, 0.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
#card { width: 300px; max-width: 100%; padding: 16px 16px 14px; text-align: center; border-width: 4px; border-radius: 20px; }
#card .rib { display: inline-block; background: var(--star); color: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: 2px 14px; font: 800 16px/1.3 var(--font); letter-spacing: 1px; }
#card h3 { font: 800 30px/1.05 var(--font); margin: 4px 0 2px; }
#card .ln { font-size: 15px; }
#card .par { font-size: 14px; margin-top: 6px; }
#card .rw { font-size: 18px; font-weight: 800; margin-top: 6px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
#card .go { font-size: 13px; margin-top: 8px; opacity: 0.7; }
#card canvas { margin: 2px auto 0; }
#closed { position: fixed; inset: 0; z-index: 60; background: rgba(124, 194, 67, 0.75); display: none; align-items: center; justify-content: center; padding: 24px; }
#closed.on { display: flex; }
#closed .panel { padding: 18px 20px; text-align: center; max-width: 300px; }
#closed h3 { font: 800 22px/1.1 var(--font); margin-bottom: 4px; }
#closed p { font-size: 15px; }
#medal { position: fixed; left: 0; top: 0; z-index: 49; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; width: 300px; max-width: calc(100vw - 16px); }
#medal canvas { flex: none; }
#medal .rib { display: inline-block; padding: 1px 8px; font: 800 13px/1.4 var(--font); letter-spacing: 1px; border: 2px solid var(--ink); border-radius: 8px; background: var(--coin); }
#medal .rib.c2 { background: #fff; } #medal .rib.c3 { background: var(--bad); color: #fff; } #medal .rib.c4 { background: var(--roof-b); color: #fff; }
#medal h4 { font: 800 18px/1.1 var(--font); margin-top: 3px; }
#medal .ln { font-size: 13px; line-height: 1.2; }
#medal .rw { font-size: 15px; font-weight: 800; margin-top: 3px; display: flex; align-items: center; font-variant-numeric: tabular-nums; }
#medal .rosettes { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }

/* landscape phones: tools in two columns, a lower top bar */
@media (max-height: 460px) {
  #tools { display: grid; grid-template-columns: repeat(2, 60px); gap: 2px 4px; }
  .tool .tb { width: 46px; height: 46px; }
  .tool { width: 60px; }
  #topR { flex-direction: row-reverse; }
  #bar { right: 140px; }
  #nbar { right: 140px; }
  #sheet { top: calc(env(safe-area-inset-top) + 54px); }
}

/* ---------- round B: building sites, housing, the Friends sheet ---------- */
.pbar { height: 14px; border: 2px solid var(--wood-d); border-radius: 7px; margin: 5px 0 3px; background: var(--cream-d); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--good); border-radius: 5px; }
.st { font-size: 13px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.empty.sm { padding: 8px; font-size: 14px; }
.sitetop { display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin-bottom: 10px; box-shadow: none; background: #E8F4D4; }
.sitetop .pic { position: relative; flex: none; border-radius: 10px; background: #FFFDF5; border: 2px solid var(--wood-d); padding: 2px; }
.sitetop .tag, .hstrip .tag { position: absolute; top: -8px; left: -6px; padding: 0 6px; font: 800 13px/18px var(--font); background: var(--warn); color: #fff; border: 2px solid var(--ink); border-radius: 8px; }
.sitetop .nm { font: 800 18px/1.1 var(--font); }
.sitetop .ln { font-size: 13px; line-height: 1.2; }
.prow { display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 10px; margin-bottom: 8px; box-shadow: none; border-width: 2px; }
.prow canvas { flex: none; }
.prow .nm { font: 800 16px/1.1 var(--font); }
.prow.done { background: #E8F4D4; }
.prow .acts { flex: none; display: flex; flex-direction: column; gap: 8px; min-width: 70px; align-items: stretch; }
.prow .acts .fat { min-height: 44px; padding: 0 8px; font-size: 15px; }
.prow .stamp { margin: 0; text-align: center; }
.built { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 6px; }
.built .bpic { position: relative; width: 180px; height: 150px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle, #FFF3B0 0 45%, transparent 70%); }
.built .bstar { position: absolute; }
.built .bstar.b0 { left: 4px; top: 8px; } .built .bstar.b1 { right: 2px; top: 22px; } .built .bstar.b2 { left: 30px; bottom: 0; }
.built h3 { font: 800 36px/1 var(--font); color: var(--star); text-shadow: 0 2px 0 var(--ink); }
.built .ln { font-size: 15px; font-weight: 700; }
.built .fat { max-width: 260px; margin-top: 8px; }
.hstrip { position: relative; display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin-bottom: 12px; box-shadow: none; background: #E8F4D4; }
.hstrip canvas { flex: none; }
.hstrip b { font: 800 16px/1.1 var(--font); }
.hstrip .fat { flex: none; padding: 0 10px; font-size: 15px; }
.ic.hs .nm { min-height: 0; margin: 2px 0; }
.ic.hs.rdy { background: #FFF6C8; border-color: var(--coin-r); }
.ic.hs .tag { font-variant-numeric: tabular-nums; }
.ic.hs .fat { min-height: 44px; font-size: 14px; padding: 0 4px; }
.feeds { display: flex; gap: 4px; justify-content: center; margin: 1px 0 2px; }
.feeds i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--wood-d); background: var(--cream-d); }
.feeds i.on { background: var(--good); border-color: var(--good-d); }
.fgrid { display: flex; flex-wrap: wrap; gap: 14px 10px; padding: 4px 2px; }
.ent .cnt { flex: none; font: 800 17px/1 var(--font); padding: 4px 8px; background: var(--coin); border: 2px solid var(--coin-r); border-radius: 10px; }
.ent.req .fat, .ent > .fat { flex: none; min-width: 70px; min-height: 44px; font-size: 15px; padding: 0 10px; }
.ent .want { display: flex; align-items: center; gap: 4px; }
.coopme { padding: 10px; margin-bottom: 6px; box-shadow: none; background: #FFFDF5; }
.coopme .ch { display: flex; gap: 10px; align-items: center; }
.coopme .ch canvas { flex: none; }
.coopme .nm { font: 800 18px/1.1 var(--font); }
.coopme .pbar { height: 18px; border-radius: 9px; }
.tiers { display: flex; gap: 6px; margin: 8px 0 2px; }
.tier { flex: 1 1 0; min-width: 0; display: flex; gap: 5px; align-items: flex-start; padding: 5px 6px; border: 2px solid var(--wood-d); border-radius: 10px; background: var(--cream); font-size: 13px; line-height: 1.2; }
.tier i { flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--ink); }
.tier.gone { opacity: 0.45; }
.mem { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.mem canvas { flex: none; }
.mem .mn { display: flex; justify-content: space-between; font-size: 14px; font-variant-numeric: tabular-nums; }
.mem .pbar { height: 10px; margin: 2px 0 0; }
.post { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px 10px; margin-bottom: 10px; box-shadow: none; border-width: 2px; }
.post > canvas { flex: none; }
.post .nm { font: 800 16px/1.1 var(--font); }
.post .ln { font-size: 14px; font-weight: 700; line-height: 1.2; }
.post .when { font-size: 13px; opacity: 0.75; }
.post .pp { position: relative; flex: none; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; background: #E8F4D4; border-radius: 12px; border: 2px solid rgba(143, 90, 43, 0.5); }
.post .pp .lvn { position: absolute; font: 800 16px/1 var(--font); color: var(--ink); }
.post .fat { min-height: 44px; font-size: 15px; }
.post.mine { background: var(--cream-d); }
.tier.now { border-color: var(--coin-r); box-shadow: 0 0 0 2px var(--coin); }
.st.rule { margin-top: 4px; }

/* ---------- round C: season banner, villagers, tool size, accounts, combined level-up ---------- */
#season { position: absolute; left: 8px; top: calc(env(safe-area-inset-top) + 64px); max-width: calc(100% - 76px); min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 2px 14px 2px 6px; font: 800 14px/1.1 var(--font); text-align: left; border-color: var(--acc, var(--star)); background: #FFF1DD; }
#season #seasonText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#season #seasonIc { flex: none; display: flex; }
#season.between { background: var(--cream); border-style: dashed; }
#season:active { transform: translateY(2px) scale(0.95); }
body.season #quest { top: calc(env(safe-area-inset-top) + 114px); }
#questFace { flex: none; margin-left: -8px; border-radius: 50%; }
#toolSize { position: absolute; top: 3px; left: -50px; width: 46px; height: 46px; pointer-events: auto; border-radius: 50%; background: var(--cream); border: 3px solid var(--wood-d); box-shadow: 0 3px 0 var(--wood-d), var(--drop); font: 800 14px/1 var(--font); font-variant-numeric: tabular-nums; }
#toolSize.on { background: var(--coin); border-color: var(--coin-r); box-shadow: 0 3px 0 var(--coin-r), var(--drop); }
#toolSize:active { transform: translateY(2px) scale(0.95); }
.tab.seas { border-color: var(--star); }
.tab.seas:not(.on) { background: #FFF1DD; }
.ic.seas { border-color: var(--star); background: #FFF6EA; box-shadow: 0 3px 0 rgba(255, 138, 61, 0.6); }
.ic.seas .tag { background: var(--star); color: #fff; border-color: var(--ink); }
.note.seasnote { color: #B4561A; }
.seastop { background: #FFF1DD; border-color: var(--acc, var(--star)); }
.seastop b { font-size: 18px; }
.vrow { cursor: pointer; }
.vrow .role { opacity: 0.75; }
.vrow.locked { background: var(--cream-d); }
.vrow.locked > canvas { filter: grayscale(1); opacity: 0.45; }
.vrow.locked .nm { opacity: 0.6; }
.vrow.done { background: #E8F4D4; }
.vrow.ready { background: #FFF6C8; border-color: var(--coin-r); }
.vrow > .fat { flex: none; min-width: 70px; min-height: 44px; font-size: 15px; padding: 0 10px; }
.vlock { flex: none; display: inline-flex; align-items: center; padding: 0 8px; font: 800 13px/24px var(--font); background: var(--cream); border: 2px solid var(--wood-d); border-radius: 10px; white-space: nowrap; }
.vtop { display: flex; gap: 12px; align-items: center; padding: 10px; margin-bottom: 10px; box-shadow: none; background: #FFFDF5; }
.vpic { flex: none; width: 104px; height: 104px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #E8F4D4; border: 3px solid var(--wood-d); }
.vtop .nm { font: 800 22px/1.05 var(--font); }
.vtop .role { font-size: 14px; opacity: 0.75; }
.vdots { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.vdots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--wood-d); background: var(--cream-d); }
.vdots i.on { background: var(--good); border-color: var(--good-d); }
.vdots i.now { background: var(--coin); border-color: var(--coin-r); }
.vstep { padding: 10px 12px 12px; margin-bottom: 10px; box-shadow: none; display: flex; flex-direction: column; gap: 4px; }
.vstep.ready { background: #FFF6C8; border-color: var(--coin-r); }
.vstep.done { background: #E8F4D4; }
.vstep .tierh { margin: 0; }
.vstep .nm { font: 800 18px/1.1 var(--font); }
.vstep .ln { font-size: 14px; font-weight: 700; line-height: 1.25; }
.vstep .ln.big { font-size: 17px; }
.vstep .pbar { height: 18px; border-radius: 9px; }
.vstep .fat { margin-top: 6px; }
.vrw { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin-top: 4px; }
.vrw canvas { flex: none; }
.vrw .rwi { color: #B4561A; }
.acct { padding: 10px 12px 12px; margin-bottom: 10px; box-shadow: none; display: flex; flex-direction: column; gap: 4px; }
.acct .nm { font: 800 18px/1.1 var(--font); }
.acct .ln { font-size: 14px; font-weight: 600; line-height: 1.25; }
.acct .fat { margin-top: 6px; }
.acct.done { background: #E8F4D4; }
.lead.pkline { font-size: 15px; padding: 8px 10px; background: #E8F4D4; border-radius: 12px; }
.mhint { padding: 8px 12px; font-size: 14px; font-weight: 700; max-width: 240px; }
#lvlupWhat { margin-top: 4px; font-size: 14px; font-weight: 700; line-height: 1.2; white-space: normal; }
#lvlupList .more { display: flex; align-items: center; padding: 0 6px; font: 800 15px/1 var(--font); }
#lvlup .lt { min-width: 0; }
#lvlup.big small { color: var(--bad); }
@media (max-width: 599px) {
  #lvlup { max-width: calc(100vw - 96px); padding: 10px 14px 10px 8px; }
  #lvlup canvas#lvlupStar { width: 60px !important; height: 60px !important; }
  #lvlup b { font-size: 30px; }
  #medal { max-width: calc(100vw - 94px); }
}
.vask { display: flex; gap: 8px; align-items: center; }
.vask canvas { flex: none; }
#sheetTabs.many { gap: 3px; padding: 8px 5px 6px; }
#sheetTabs.many .tab { padding: 3px 0; }
