/* Đảo Vườn, Kho Lương, Sạp Hạt Giống, Bếp Rồng, trang trí (farm.js). Tokens of the design team's mock-ups
   (output/farm-island/delivery-v1.0/ui/mockups/layout.json): bg #092c36, panel #123841, gold #ffcd69, text #eaf4ed. */
:root { --fm-panel: #123841; --fm-panel2: #0e2f37; --fm-gold: #ffcd69; --fm-wood: #7a4e2a; --fm-wood2: #a8723c; --fm-text: #eaf4ed; }
.fi { position: static !important; inset: auto !important; translate: none !important; display: inline-block; vertical-align: middle; flex: none; object-fit: contain; -webkit-user-drag: none; user-select: none; }

/* ---- HUD over the 3D --------------------------------------------------------------------------------------- */
#farm-hud { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
#farm-hud > * { pointer-events: auto; }
#farm-hud .fm-only { display: none; }
body.farm-on #farm-hud .fm-only:not([hidden]) { display: flex; }
#farm-fx { position: absolute; inset: 0; pointer-events: none; z-index: 7; overflow: hidden; }
body.farm-on .feature-sidebar, body.farm-on .scene-pills, body.farm-on #expand-open, body.farm-on .visitors-bar, body.farm-on #guard-line,
body.farm-on .island-status, body.farm-on .sea-label, body.farm-on #object-card, body.decor-on .scene-pills, body.decor-on .feature-sidebar, body.decor-on #object-card { display: none !important; }
.fm-badge { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #e8463a; color: #fff; font: 800 12px/22px system-ui; font-style: normal; text-align: center; box-shadow: 0 2px 4px #0006; }
.fm-season { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0 6px; padding: 4px 10px 4px 6px; border-radius: 999px; border: 1px solid #ffcd6955; background: #123945dd; color: #ffe0a0; font-size: 12px; cursor: pointer; vertical-align: middle; }
.fm-season b { font-weight: 800; } .fm-season small { color: #cfe3df; font-size: 11px; }
.fm-season.is-rain { border-color: #7fd3ff66; color: #cdeeff; }
.fm-ripe { position: absolute; top: 64px; right: calc(env(safe-area-inset-right, 0px) + 12px); align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 16px; background: #123841ee; border: 1px solid #ffffff1c; color: var(--fm-text); box-shadow: 0 6px 16px #0005; }
.fm-ripe span { display: flex; flex-direction: column; line-height: 1.2; } .fm-ripe b { font-size: 16px; } .fm-ripe small { color: #a1b9b9; font-size: 12px; }
.fm-side { position: absolute; right: calc(env(safe-area-inset-right, 0px) + 12px); top: 128px; flex-direction: column; gap: 8px; }
.fm-side button { display: flex; align-items: center; gap: 8px; min-width: 132px; padding: 6px 12px 6px 6px; border-radius: 14px; border: 1px solid #ffffff1f; background: #123841e6; color: var(--fm-text); font-weight: 700; font-size: 13px; box-shadow: 0 3px 0 #061d23; }
.fm-side button[hidden] { display: none; }
.fm-all { position: absolute; right: calc(env(safe-area-inset-right, 0px) + 12px); bottom: 12px; align-items: center; gap: 8px; padding: 8px 18px 8px 10px; border-radius: 16px; border: 0; background: linear-gradient(#ffe08f, #ffcd69); color: #4a2f10; font-weight: 800; font-size: 15px; box-shadow: 0 4px 0 #b88a2e, 0 8px 16px #0005; }
.fm-all:active { translate: 0 2px; box-shadow: 0 2px 0 #b88a2e; }

/* Food chip: Kho Lương used / capacity + mini bar; orange at 90%, red when full, shakes when a harvest bounces. */
#nation-status .fm-chip { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#nation-status .fm-chip-t { display: inline-flex; flex-direction: column; gap: 2px; line-height: 1.1; }
#nation-status .fm-chip-t b { color: #fff3d0; font-size: 13px; }
.fm-mini { display: block; width: 74px; height: 6px; border-radius: 3px; background: #0b2a31; overflow: hidden; }
.fm-mini i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #ffd977, #ffb347); }
#nation-status.fm-warn { box-shadow: 0 0 0 2px #ffb347aa; } #nation-status.fm-warn .fm-mini i { background: #ff9a3a; }
#nation-status.fm-full { box-shadow: 0 0 0 2px #f15f5f; background: #4a1e22e6; } #nation-status.fm-full .fm-mini i { background: #f15f5f; }
#nation-status .fm-hungry { color: #ffb0a0; font-style: normal; font-weight: 700; }
#nation-status small { color: #ffe0a0; font-size: 12px; }
#nation-status.fm-shake { animation: fm-shake .5s; } #nation-status.fm-pulse { animation: fm-pulse .35s; }
@keyframes fm-shake { 0%, 100% { translate: 0; } 20% { translate: -6px; background: #8a2a2a; } 40% { translate: 6px; } 60% { translate: -4px; background: #8a2a2a; } 80% { translate: 3px; } }
@keyframes fm-pulse { 50% { scale: 1.08; } }

/* Tray: seed bags, Liềm Móng Rồng, watering can (bottom centre). */
.fm-tray { position: absolute; left: 50%; bottom: 10px; translate: -50% 0; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 360px); padding: 8px 10px; border-radius: 18px; background: linear-gradient(#a8723c, #7a4e2a); border: 3px solid #d9a35a; box-shadow: inset 0 0 0 2px #5a3518, 0 8px 20px #0007; touch-action: none; }
.fm-tray[hidden], .fm-build[hidden], .fm-combo[hidden] { display: none !important; }
.fm-slots { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; align-items: center; }
.fm-slots::-webkit-scrollbar { display: none; }
.fm-slot { position: relative; flex: none; display: grid; place-items: center; width: 72px; height: 76px; padding: 2px 0 14px; border-radius: 14px; border: 2px solid #5a3518; background: radial-gradient(circle at 50% 40%, #8a5a30, #5e3a1c); color: #fff; touch-action: none; cursor: grab; }
.fm-slot.on { border-color: #ffe08f; box-shadow: 0 0 0 3px #ffcd69, 0 0 16px #ffcd69aa; background: radial-gradient(circle at 50% 40%, #b07a40, #7a4e2a); }
.fm-slot.empty .fi { filter: grayscale(.7) brightness(.8); }
.fm-slot.off { opacity: .45; }
.fm-n { position: absolute; right: 6px; bottom: 14px; font: 800 14px/1 system-ui; color: #fff; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
.fm-name { position: absolute; left: 2px; right: 2px; bottom: 1px; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #ffe8bf; }
.fm-price { position: absolute; top: 2px; left: 50%; translate: -50% 0; padding: 0 5px; border-radius: 6px; background: #ffcd69; color: #4a2f10; font: 800 10px/16px system-ui; white-space: nowrap; }
.fm-rare { position: absolute; top: 2px; left: 4px; padding: 0 4px; border-radius: 5px; background: #8a4fd0; color: #fff; font: 700 9px/14px system-ui; font-style: normal; }
.fm-tool { width: 96px; height: 84px; }
.fm-tool-hint { margin: 0 6px; max-width: 220px; color: #fff3d0; font-size: 13px; line-height: 1.35; }
.fm-tray-side { display: flex; flex-direction: column; gap: 6px; flex: none; }
.fm-tray-side button { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 10px; border: 1px solid #5a3518; background: #fff3d0; color: #4a2f10; font-weight: 800; font-size: 12px; }
.fm-tray-x, .fm-build .fm-tray-x { width: 34px; height: 34px; justify-content: center; border-radius: 50% !important; padding: 0 !important; background: #123841 !important; color: #fff !important; border: 2px solid #ffffff33 !important; font-size: 15px; }
.fm-tray-hint { position: absolute; left: 50%; top: -26px; translate: -50% 0; margin: 0; padding: 3px 10px; border-radius: 10px; background: #092c36dd; color: #fff3d0; font-size: 12px; white-space: nowrap; pointer-events: none; }
.fm-combo { position: absolute; left: 50%; top: 18%; translate: -50% 0; z-index: 8; pointer-events: none !important; display: grid; place-items: center; width: 180px; height: 120px; background: radial-gradient(closest-side, #ffe27a88, #ffcd6900); }
.fm-combo b { color: #fff3c4; font-weight: 900; -webkit-text-stroke: 2px #a0601a; text-shadow: 0 3px 0 #7a4a12, 0 0 18px #ffcd69; }
.fm-combo.pop { animation: fm-pop .35s cubic-bezier(.2, 1.6, .5, 1); }
@keyframes fm-pop { from { scale: .5; } }
.fm-build { position: absolute; left: 50%; bottom: 10px; translate: -50% 0; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); padding: 8px 10px; border-radius: 16px; background: #123841f2; border: 2px solid #ffcd6966; color: var(--fm-text); box-shadow: 0 8px 20px #0007; flex-wrap: wrap; justify-content: center; }
.fm-build > span:not(.fm-decor-ic):not(.fm-ground) { display: flex; flex-direction: column; line-height: 1.25; min-width: 140px; } .fm-build small { color: #a1b9b9; font-size: 11px; }
.fm-build button { padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; }
body.decor-on #farm-hud .fm-only, body.decor-on .fm-tray { display: none !important; }

/* 2D effects */
.fm-float { position: absolute; z-index: 2; translate: 0 0; white-space: nowrap; font: 900 18px/1 system-ui; color: #fff; text-shadow: 0 2px 0 #3a2a10, 0 0 6px #000a; display: flex; align-items: center; gap: 2px; }
.fm-float.gain { color: #fff3c4; } .fm-float.seed { color: #c9f5a0; font-size: 15px; } .fm-float.rare { color: #e6c8ff; font-size: 16px; } .fm-float.warn { color: #ffb0a0; font-size: 14px; }
.fm-float small { font-size: 11px; color: #ffd0a0; }
.fm-fly { position: absolute; left: 0; top: 0; z-index: 3; filter: drop-shadow(0 3px 3px #0007); }
.fm-ghost { position: absolute; left: 0; top: 0; z-index: 4; filter: drop-shadow(0 6px 6px #0008); pointer-events: none; }
.fm-ghost[hidden] { display: none; }
.fm-bubble { position: absolute; z-index: 5; translate: -50% -115%; padding: 6px 10px; border-radius: 10px; background: #123841f2; border: 1px solid #ffcd6966; color: var(--fm-text); font-size: 12px; line-height: 1.4; text-align: center; white-space: nowrap; box-shadow: 0 6px 14px #0006; animation: fm-in .2s; }
.fm-bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; translate: -50% 0; border: 6px solid transparent; border-bottom: 0; border-top-color: #123841f2; }
@keyframes fm-in { from { opacity: 0; translate: -50% -100%; } }
.fm-taken { position: fixed; left: 50%; bottom: 84px; z-index: 9999; inset: auto auto 84px 50%; margin: 0; translate: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 16px; border: 1px solid #ffcd6966; background: #123841f2; color: var(--fm-text); box-shadow: 0 8px 18px #0007; }
.fm-taken span { display: inline-flex; align-items: center; gap: 2px; } .fm-taken small { font-weight: 800; }
.fm-heart-fly { position: fixed; z-index: 9999; pointer-events: none; }
.fm-farmhits { margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: #2a1e10cc; color: #ffe0a0; font-size: 13px; line-height: 1.45; }
.fm-got { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0 10px; }
.fm-got span { display: inline-flex; align-items: center; gap: 3px; padding: 4px 8px; border-radius: 10px; background: #0b2a31; font-weight: 700; }
.wheel-seedbag svg { display: block; }
.wheel-seedbag img { display: block; width: 40px; height: 40px; margin: -4px auto -4px; object-fit: contain; } /* ic_seed_bag@512 (đợt 2), both Hạt sectors */

/* ---- dialogs ------------------------------------------------------------------------------------------------- */
.fm-pop { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 4px 6px; }
.fm-pop h2 { margin: 2px 0; color: var(--fm-gold); text-transform: uppercase; letter-spacing: .02em; }
.fm-pop p { margin: 2px 0; }
.fm-pop-row { display: flex; justify-content: space-between; gap: 30px; width: min(320px, 100%); padding: 6px 12px; border-radius: 10px; background: #0b2a31; }
.fm-pop-row .ok { color: #8fe06a; } .fm-pop-row .bad, .bad { color: #ff8a7a; }
.fm-pop-note { color: #ffd0a0; font-size: 13px; max-width: 420px; }
.fm-pop-btns { display: flex; justify-content: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.fm-pop-btns { flex-wrap: nowrap; } .fm-pop-btns button { flex: 1 1 0; width: auto !important; min-width: 0; max-width: 260px; min-height: 44px; margin: 0 !important; }
.fm-link { margin-top: 4px; font-size: 13px; }
.fm-tabs { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.fm-tabs button { padding: 8px 18px; border-radius: 12px; border: 1px solid #ffffff22; background: #1b4650; color: var(--fm-text); font-weight: 700; }
.fm-tabs button.on { background: linear-gradient(#ffe08f, #ffcd69); color: #4a2f10; border-color: transparent; box-shadow: 0 3px 0 #b88a2e; }
.fm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e8463a; vertical-align: middle; }
.fm-note { margin: 8px 0 0; color: #a1b9b9; font-size: 12px; line-height: 1.5; }
.fm-empty { padding: 30px 10px; text-align: center; color: #a1b9b9; }
.fm-granary h2, .fm-shop h2, .fm-decor h2, .fm-board h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--fm-gold); }
.fm-granary h2 small { color: #a1b9b9; font-size: 13px; font-weight: 600; }
.fm-gr-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fm-gr-cap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }
.fm-cap { flex: 1; height: 16px; border-radius: 8px; background: #0b2a31; border: 2px solid #5a3518; overflow: hidden; }
.fm-cap i { display: block; height: 100%; background: linear-gradient(#ffe08f, #f5b54a); border-radius: 6px; transition: width .4s; }
.fm-cap.warn i { background: linear-gradient(#ffc27a, #ff9a3a); } .fm-cap.full i { background: linear-gradient(#ff9a8a, #e8463a); }
.fm-cap-n { white-space: nowrap; color: #fff3d0; }
.fm-up { white-space: nowrap; } .fm-max { color: #8fe06a; font-weight: 700; }
.fm-gr-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 0; color: #a1b9b9; font-size: 12px; }
.fm-feed { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; }
.fm-shelf { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 8px; padding: 12px 10px; border-radius: 14px; background: linear-gradient(#7a4e2a, #5e3a1c); border: 3px solid #a8723c; box-shadow: inset 0 -8px 0 #4a2a12; }
.fm-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; background: #00000026; text-align: center; color: #fff3d0; }
.fm-item b { font-size: 13px; line-height: 1.2; } .fm-item small { font-size: 11px; color: #ffe0b0; } .fm-item .fm-fav { color: #c9f5a0; }
.fm-item.locked { outline: 2px solid #ffcd69aa; }
.fm-item-btns { display: flex; gap: 4px; margin-top: 2px; }
.fm-item-btns button { padding: 3px 9px; border-radius: 8px; font-size: 12px; }
.fm-lock { display: grid; place-items: center; width: 30px; height: 28px; padding: 0 !important; border-radius: 8px; border: 1px solid #ffffff33; background: #0b2a31; opacity: .55; }
.fm-lock.on { opacity: 1; background: #5a4010; border-color: #ffcd69; }
.fm-sell { position: absolute; z-index: 3; left: 50%; top: 100%; translate: -50% -4px; display: flex; flex-direction: column; gap: 4px; min-width: 170px; padding: 8px; border-radius: 10px; background: #092c36; border: 1px solid #ffcd6966; box-shadow: 0 8px 16px #0008; font-size: 11px; }
.fm-sell[hidden] { display: none; }
.fm-sell button { padding: 4px 8px; border-radius: 8px; background: #ffcd69; color: #4a2f10; font-weight: 800; border: 0; }
.fm-shop-head, .fm-decor-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.fm-packs { display: flex; align-items: center; gap: 8px; } .fm-packs span { color: #a1b9b9; font-size: 13px; }
.fm-packs button { padding: 6px 16px; border-radius: 12px; border: 1px solid #ffffff22; background: #1b4650; color: var(--fm-text); font-weight: 800; }
.fm-packs button.on { background: linear-gradient(#ffe08f, #ffcd69); color: #4a2f10; }
.fm-seedgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.fm-seedcard { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: #173f49; border: 1px solid #ffffff1a; }
.fm-seedcard.focus { border-color: var(--fm-gold); box-shadow: 0 0 0 2px #ffcd6955; }
.fm-seedcard.locked { opacity: .55; }
.fm-sc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; } .fm-sc-info b { color: var(--fm-gold); font-size: 15px; } .fm-sc-info small { font-size: 12px; }
.fm-seedcard { flex-wrap: wrap; }
.fm-buy3 { display: flex; gap: 6px; flex: 1 1 100%; }
.fm-buy3 button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 40px; padding: 4px 6px !important; margin: 0 !important; width: auto !important; line-height: 1.15; }
.fm-buy3 small { font-size: 11px; font-weight: 700; opacity: .85; }
.fm-kq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fm-kslot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border-radius: 12px; background: #0b2a31; border: 1px dashed #ffffff2a; color: #a1b9b9; text-align: center; }
.fm-kslot.busy { border-style: solid; border-color: #ffcd6966; color: var(--fm-text); }
.fm-kbar { display: block; width: 100%; height: 6px; border-radius: 3px; background: #1b4650; overflow: hidden; } .fm-kbar i { display: block; height: 100%; background: #ffcd69; }
.fm-kready { margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: #1f4a2a; font-size: 13px; }
.fm-dish { display: inline-block; margin: 2px 4px; padding: 2px 8px; border-radius: 8px; background: #0b2a31; }
.fm-recipes { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.fm-recipe { display: grid; grid-template-columns: minmax(130px, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: #173f49; }
.fm-recipe.locked { opacity: .5; } .fm-recipe div:first-child { display: flex; flex-direction: column; } .fm-recipe small { color: #a1b9b9; font-size: 11px; }
.fm-needs { display: flex; gap: 8px; flex-wrap: wrap; } .fm-needs span { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; } .fm-needs .ok { color: #8fe06a; } .fm-needs .bad { color: #ff8a7a; }
.fm-recipe button { min-width: 84px; }
.fm-beauty { display: flex; flex-direction: column; align-items: center; padding: 4px 12px; border-radius: 12px; background: #0b2a31; line-height: 1.15; } .fm-beauty b { color: var(--fm-gold); font-size: 17px; } .fm-beauty small { color: #a1b9b9; font-size: 11px; }
.fm-decorgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.fm-decorcard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; border: 1px solid #ffffff1a; background: #173f49; color: var(--fm-text); text-align: center; }
.fm-decorcard b { font-size: 13px; } .fm-decorcard small { font-size: 11px; color: #a1b9b9; } .fm-decorcard .fm-dprice { color: var(--fm-gold); font-weight: 800; }
.fm-decorcard:disabled { opacity: .5; }
.fm-decor-ic { position: relative; overflow: hidden; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; font-size: 24px; color: #fff; background: #3a6a4a; box-shadow: inset 0 -4px 0 #0003; }
.fm-decor-ic.g-fence { background: #a8763f; } .fm-decor-ic.g-light { background: #d98a2a; } .fm-decor-ic.g-plant { background: #4f9f4a; } .fm-decor-ic.g-sea { background: #2f7fa8; } .fm-decor-ic.g-treasure { background: #c9a227; } .fm-decor-ic.g-dragon { background: #7a5aa8; }
.fm-ground { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; border: 2px solid #ffffff33; color: #fff; }
.g-grass { background: #7cbf5a; } .g-sand { background: #e8d29a; } .g-stone { background: repeating-linear-gradient(45deg, #a7a59c 0 8px, #8f8d85 8px 10px); } .g-wood { background: repeating-linear-gradient(90deg, #a8763f 0 9px, #8a5a32 9px 11px); } .g-flowers { background: radial-gradient(#ff8ad8 20%, transparent 22%) 0 0 / 12px 12px, #7cbf5a; } .g-shallow { background: #5cc3d6; } .g-none { background: #0b2a31; }
.fm-board .fm-rank { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fm-rank li { display: grid; grid-template-columns: 34px 1fr auto auto auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: #173f49; }
.fm-rank li.me { outline: 2px solid var(--fm-gold); }
.fm-rank small { color: #a1b9b9; } .fm-rk { font-weight: 900; color: var(--fm-gold); text-align: center; }
.fm-bs, .fm-hs { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.fm-dishpick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding: 8px; border-radius: 12px; background: #0b2a31; border: 1px solid #ffcd6966; }
.fm-dishpick button { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.fm-heart-btn.done { opacity: .7; }

/* Phone landscape (844 × 390 and smaller heights) */
html.short .fm-tray, html.phone .fm-tray { bottom: 6px; max-width: calc(100% - 290px); padding: 5px 6px; border-width: 2px; }
html.short .fm-slot, html.phone .fm-slot { width: 56px; height: 60px; }
html.short .fm-slot .fi, html.phone .fm-slot .fi { width: 34px !important; height: 34px !important; }
html.short .fm-tool, html.phone .fm-tool { width: 74px; height: 64px; }
html.short .fm-tool-hint, html.phone .fm-tool-hint { font-size: 11px; max-width: 150px; }
html.short .fm-side, html.phone .fm-side { top: 58px; gap: 5px; }
html.short .fm-side button, html.phone .fm-side button { min-width: 0; padding: 3px 8px 3px 3px; font-size: 11px; }
html.short .fm-side .fi, html.phone .fm-side .fi { width: 22px !important; height: 22px !important; }
html.short .fm-ripe, html.phone .fm-ripe { top: 8px; padding: 4px 10px 4px 6px; } html.short .fm-ripe b, html.phone .fm-ripe b { font-size: 13px; }
html.short .fm-ripe .fi, html.phone .fm-ripe .fi { width: 22px !important; height: 22px !important; }
html.short .fm-all, html.phone .fm-all { bottom: 8px; padding: 4px 12px 4px 6px; font-size: 13px; } html.short .fm-all .fi, html.phone .fm-all .fi { width: 26px !important; height: 26px !important; }
html.short .fm-season small, html.phone .fm-season small { display: none; }
html.short .fm-tray-hint, html.phone .fm-tray-hint { top: -21px; padding: 2px 8px; font-size: 11px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .fm-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fm-seedgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fm-decorgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fm-recipe { grid-template-columns: 1fr auto; } .fm-recipe .fm-needs { grid-column: 1; }
  .fm-rank li { grid-template-columns: 28px 1fr auto auto; } .fm-rank li small { display: none; }
}
@media (max-height: 430px) {
  .fm-item > .fi, .fm-seedcard > .fi { width: 40px !important; height: 40px !important; }
  .fm-pop > .fi { width: 52px !important; height: 52px !important; }
  .fm-pop-btns button { min-height: 38px; }
}
#nation-status { pointer-events: auto; } /* the food chip opens the Kho Lương (the title bar only lets buttons through) */
html.short .fm-ripe, html.phone .fm-ripe { top: 56px; } html.short .fm-side, html.phone .fm-side { top: 104px; }
.fm-decor-ic img { position: absolute !important; inset: 0; width: 100%; height: 100%; object-fit: contain; display: none; }
.fm-decor-ic img.is-3d { display: block; } .fm-decor-ic:has(img.is-3d) { background: #0b2a31; }
/* Viễn Chinh with the whole herd hungry: why the fight buttons are off, and Cho ăn hàng loạt right there (expedition.js). */
.exp-hungry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; padding: 8px 10px; border-radius: 12px; background: #5a1f1fcc; border: 1px solid #c0634f; color: #ffe1d6; font-size: 13px; line-height: 1.35; }
.exp-hungry span { flex: 1 1 180px; } .exp-hungry button { flex: none; min-height: 36px; }

/* Khay hạt (the owner 21/11): the whole bottom row, from after the island toggle to the right edge, the bags scroll sideways
   (farm.js onTrayDown: a swipe along the row scrolls it, a drag across it sows). The Ghé thăm bar hides on the Đảo Vườn. */
.fm-tray { left: calc(env(safe-area-inset-left, 0px) + 190px); right: calc(env(safe-area-inset-right, 0px) + 12px); translate: none; max-width: none; }
.fm-tray .fm-slots { flex: 1 1 auto; min-width: 0; overscroll-behavior: contain; }
html.short .fm-tray, html.phone .fm-tray { left: calc(env(safe-area-inset-left, 0px) + 168px); right: calc(env(safe-area-inset-right, 0px) + 8px); max-width: none; }
#farm-hud:has(#farm-tray:not([hidden])) .fm-all { display: none !important; }
body.farm-on .visitors-bar { display: none !important; }
.fm-open-granary { display: block; width: 100%; min-height: 40px; margin-top: 6px; }
/* Island switcher (farm.js isleSwitch, the owner 21/11): Đảo quân sự / Đảo Vườn / Đảo Rồng, bottom left on the island
   screen and on Đảo Rồng's screen; the camera flies across the sea to the island picked (island3d.js go). Fits in the
   room the old Đảo Vườn toggle had, left of the seed tray (190 px, 168 px on phones). */
.isle-switch { position: absolute; left: calc(env(safe-area-inset-left, 0px) + 12px); bottom: 12px; z-index: 4; display: flex; gap: 4px; padding: 4px; border-radius: 16px; border: 2px solid #ffffff22; background: linear-gradient(#1c4c57f2, #123841f2); box-shadow: 0 4px 0 #061d23, 0 8px 18px #0006; pointer-events: auto; }
.isle-switch:empty { display: none; }
.isle-btn { position: relative; display: grid; justify-items: center; align-content: center; gap: 1px; width: 54px; min-height: 48px; padding: 3px 2px; border: 0; border-radius: 12px; background: transparent; color: #cfe3df; font: inherit; cursor: pointer; touch-action: manipulation; }
.isle-btn .isle-ic { display: grid; place-items: center; width: 28px; height: 28px; }
.isle-btn .isle-ic img, .isle-btn .isle-ic svg { width: 26px !important; height: 26px !important; object-fit: contain; }
.isle-btn b { font-size: 10.5px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.isle-btn.on { background: linear-gradient(#ffe08a, #f2b43c); color: #4a2f10; box-shadow: inset 0 -2px 0 #b97a1a; cursor: default; }
.isle-btn:not(.on):hover { background: #ffffff14; color: #fff; }
.isle-btn:not(.on):active { translate: 0 1px; }
.isle-btn .fm-badge { top: -6px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; font-size: 11px; line-height: 18px; }
html.short .isle-switch, html.phone .isle-switch { left: calc(env(safe-area-inset-left, 0px) + 8px); bottom: 8px; gap: 2px; padding: 3px; border-radius: 14px; }
html.short .isle-btn, html.phone .isle-btn { width: 48px; min-height: 42px; padding: 2px 1px; }
html.short .isle-btn .isle-ic, html.phone .isle-btn .isle-ic { width: 24px; height: 24px; }
html.short .isle-btn .isle-ic img, html.short .isle-btn .isle-ic svg, html.phone .isle-btn .isle-ic img, html.phone .isle-btn .isle-ic svg { width: 22px !important; height: 22px !important; }
html.short .isle-btn b, html.phone .isle-btn b { font-size: 9.5px; }
/* On Đảo Rồng's screen the switcher takes the "← Đảo của tôi" place in the top bar (the bottom row is full there). */
.dragon-top .isle-switch { position: static; flex: none; padding: 3px; gap: 2px; border-color: #ffd76a55; background: linear-gradient(180deg, #3a2350e6, #1a1226e6); box-shadow: 0 3px 0 #0d0814, 0 6px 14px #0006; }
.dragon-top .isle-switch:not(:empty) ~ [data-dragon-exit] { display: none; }
.dragon-top .isle-switch .isle-btn { min-height: 38px; width: 56px; padding: 2px 1px; border: 0; border-radius: 11px; background: transparent; color: #e8dcff; font-weight: 800; }
.dragon-top .isle-switch .isle-btn.on { background: linear-gradient(#ffe08a, #f2b43c); color: #4a2f10; }
.dragon-top .isle-switch .isle-ic { width: 22px; height: 22px; }
.dragon-top .isle-switch .isle-ic img, .dragon-top .isle-switch .isle-ic svg { width: 20px !important; height: 20px !important; }
html.short .dragon-top .isle-switch, html.phone .dragon-top .isle-switch { gap: 3px; }
html.short .dragon-top .isle-switch .isle-btn, html.phone .dragon-top .isle-switch .isle-btn { min-height: 34px; width: 50px; }
/* Cho ăn hàng loạt on a short screen: above the bottom row, so the row no longer runs off the left edge. */
html.short .dragon-bottom .dragon-hunger { position: absolute; right: 0; bottom: calc(100% + 6px); }
/* "Đang tới Đảo Vườn…": only when the next island is not ready as the camera arrives (island3d.js). */
.isle-loading { position: absolute; left: 50%; top: 50%; z-index: 2; translate: -50% -50%; display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: #092c36d9; color: #fff3d0; font-weight: 800; font-size: 14px; pointer-events: none; box-shadow: 0 6px 16px #0006; }
.isle-loading::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #ffffff55; border-top-color: #ffcd69; animation: isle-spin .8s linear infinite; }
.isle-loading[hidden] { display: none; }
@keyframes isle-spin { to { rotate: 360deg; } }
/* While the camera flies to Đảo Rồng its buttons wait: only the sea, the island and the switcher show. */
body.isle-flying .dragon-view > :not(.dragon-3d):not(.isle-switch) { visibility: hidden; }

/* Công cụ nổi beside the tapped field (farm.js floatTool): grab it and drag across the fields. */
.fm-float-tool { position: absolute; z-index: 6; translate: -50% calc(-100% - 22px); width: 66px; height: 66px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 3px solid #7a4e2a;
  background: radial-gradient(circle at 45% 38%, #fff6d8, #f0c66d 70%, #c88f3c); box-shadow: 0 6px 14px #0007, inset 0 -3px 0 #0002; pointer-events: auto; touch-action: none; cursor: grab;
  animation: fmFloatIn .22s ease-out, fmFloatBob 1.4s ease-in-out .22s infinite; }
.fm-float-tool:active { cursor: grabbing; }
/* the owner 23/11: while the sickle / can is dragged (the copy under the finger), the one left on the field hides */
.fm-float-tool.fm-dragging { opacity: 0; }
.fm-float-arrow { position: absolute; left: 50%; bottom: -22px; margin-left: -11px; width: 22px; height: 22px; border-radius: 4px; background: linear-gradient(135deg, #ffe08f, #f2a83a);
  clip-path: polygon(0 35%, 55% 35%, 55% 0, 100% 50%, 55% 100%, 55% 65%, 0 65%); transform: rotate(90deg); filter: drop-shadow(0 1px 1px #0008); animation: fmFloatPoint 1s ease-in-out infinite; }
@keyframes fmFloatIn { from { scale: .3; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes fmFloatBob { 0%, 100% { translate: -50% calc(-100% - 22px); } 50% { translate: -50% calc(-100% - 30px); } }
@keyframes fmFloatPoint { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
html.short .fm-float-tool, html.phone .fm-float-tool { width: 58px; height: 58px; }
/* "Đảo quân sự" (the owner 21/11) is longer than "Đảo chính": the island buttons size to their label. */
.isle-btn { width: auto; min-width: 54px; padding: 3px 6px; }
.dragon-top .isle-switch .isle-btn { width: auto; min-width: 50px; padding: 2px 5px; }
.fm-tray { left: calc(env(safe-area-inset-left, 0px) + 236px); }
html.short .fm-tray, html.phone .fm-tray { left: calc(env(safe-area-inset-left, 0px) + 194px); }
.isle-switch { gap: 6px; } .isle-btn { padding: 3px 8px; }
html.short .isle-switch, html.phone .isle-switch { gap: 4px; }
html.short .fm-tray, html.phone .fm-tray { left: calc(env(safe-area-inset-left, 0px) + 206px); }
.fm-tray { left: calc(env(safe-area-inset-left, 0px) + 262px); }
html.short .isle-btn, html.phone .isle-btn { width: auto; min-width: 48px; padding: 2px 5px; }
html.short .dragon-top .isle-switch .isle-btn, html.phone .dragon-top .isle-switch .isle-btn { width: auto; min-width: 46px; padding: 2px 4px; }
html.short .fm-tray, html.phone .fm-tray { left: calc(env(safe-area-inset-left, 0px) + 216px); }
/* Island switcher as a column (the owner 21/11): three full-width buttons stacked, icon and name on one line, so the
   names are never squeezed. The Đảo Rồng top bar keeps its small row (.dragon-top). */
.isle-switch:not(.dragon-top .isle-switch) { flex-direction: column; align-items: stretch; width: 184px; gap: 4px; padding: 5px; }
.isle-switch:not(.dragon-top .isle-switch) .isle-btn { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 40px; padding: 4px 12px 4px 8px; text-align: left; }
.isle-switch:not(.dragon-top .isle-switch) .isle-btn b { font-size: 13px; }
.isle-switch:not(.dragon-top .isle-switch) .isle-btn .fm-badge { top: 50%; right: 8px; translate: 0 -50%; }
html.short .isle-switch:not(.dragon-top .isle-switch), html.phone .isle-switch:not(.dragon-top .isle-switch) { width: 164px; gap: 3px; padding: 4px; }
html.short .isle-switch:not(.dragon-top .isle-switch) .isle-btn, html.phone .isle-switch:not(.dragon-top .isle-switch) .isle-btn { min-height: 34px; gap: 8px; padding: 3px 10px 3px 6px; }
html.short .isle-switch:not(.dragon-top .isle-switch) .isle-btn b, html.phone .isle-switch:not(.dragon-top .isle-switch) .isle-btn b { font-size: 12px; }
.fm-tray { left: calc(env(safe-area-inset-left, 0px) + 210px); }
html.short .fm-tray, html.phone .fm-tray { left: calc(env(safe-area-inset-left, 0px) + 182px); }
/* The Ghé thăm bar sits above the taller island switcher column (main island only; it hides on the Đảo Vườn). */
html body:not(.farm-on) .island-scene .visitors-bar { bottom: 166px !important; }
html.short body:not(.farm-on) .island-scene .visitors-bar, html.phone body:not(.farm-on) .island-scene .visitors-bar { left: calc(env(safe-area-inset-left, 0px) + 180px) !important; bottom: 8px !important; max-width: 140px !important; grid-template-columns: repeat(2, auto) !important; }
html.short body:not(.farm-on) .island-scene .visitors-bar .visitor:nth-of-type(n+4), html.phone body:not(.farm-on) .island-scene .visitors-bar .visitor:nth-of-type(n+4) { display: none !important; } /* the title opens the full list */
/* Đảo Vườn shows only the farm (the owner 21/11): no level / XP chip, no "sắp mở khoá" bar, no visitors card. */
body.farm-on #level-chip, body.farm-on #next-unlock, body.farm-on .next-unlock, body.farm-on #visitors-bar { display: none !important; }
.wheel-egg img { display: block; width: 44px; height: 44px; margin: -5px auto -5px; object-fit: contain; }
.reward-egg { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; }
/* Đặt trang trí (the owner 21/11): an arrow bouncing over a free cell and a banner telling a new player what to do. */
.fm-place-arrow { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 3; }
/* ui_place_arrow 128 × 160 (pivot bottom centre) bouncing over the cell; ui_place_ring 256 × 128 on the ground, growing and fading. */
.fm-place-arrow .arrow { position: absolute; left: -24px; bottom: 8px; width: 48px; height: 60px; animation: fmPlaceBob .9s ease-in-out infinite; filter: drop-shadow(0 3px 2px #0006); }
.fm-place-arrow .ring { position: absolute; left: -36px; top: -18px; width: 72px; height: 36px; animation: fmPlaceRing 1.1s ease-out infinite; }
@keyframes fmPlaceBob { 0%, 100% { transform: translateY(-14px); } 50% { transform: translateY(0); } }
@keyframes fmPlaceRing { 0% { transform: scale(.45); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
/* ui_hint_banner 1200 × 120, 9-slice [left, right, top, bottom] = [48, 48, 24, 24] drawn at half size; only the middle stretches. */
.fm-place-banner { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 74px); transform: translateX(-50%); max-width: min(600px, calc(100% - 32px)); box-sizing: border-box;
    min-height: 60px; display: flex; align-items: center; justify-content: center; padding: 3px 6px; border: solid transparent; border-width: 12px 24px;
    border-image: url("assets/farm/ui/ui_hint_banner.webp?v=mut463-20261127") 24 48 fill / 12px 24px stretch;
    color: #fff6d8; font-weight: 800; font-size: 15px; line-height: 1.25; text-align: center; text-shadow: 0 1px 0 #0d2a1a, 0 0 4px #0008;
    filter: drop-shadow(0 6px 10px #0007); pointer-events: none; z-index: 5; animation: fmBannerIn .3s ease-out; }
html.short .fm-place-banner, html.phone .fm-place-banner { top: calc(env(safe-area-inset-top, 0px) + 102px); font-size: 12.5px; min-height: 38px; padding: 1px 4px; border-width: 8px 16px; border-image-width: 8px 16px; }
html.short .fm-place-arrow .arrow, html.phone .fm-place-arrow .arrow { left: -19px; width: 38px; height: 48px; }
@keyframes fmBannerIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translateX(-50%); } }
/* Trang trí đợt 2: the design team's shop icons, and the Bộ sưu tập strip (a set's badge, name, placed / 5, +50 Điểm Đẹp). */
.fm-decor-ic.has-ic { background: radial-gradient(circle at 50% 40%, #2f6a5a, #123a40); }
.fm-decor-ic img.fm-decor-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.fm-decor-ic.g-garden { background: #8a6a3a; } .fm-decor-ic.g-village { background: #a8823f; }
.fm-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.fm-sets.all { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.fm-set { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; padding: 8px 10px; border-radius: 14px; background: #10333b; border: 1px solid #ffd77a33; }
.fm-set.done { border-color: #ffd77a; box-shadow: 0 0 0 1px #ffd77a55 inset, 0 0 14px #ffd04a33; }
.fm-set-badge { width: 44px; height: 44px; object-fit: contain; display: grid; place-items: center; border-radius: 50%; font-weight: 900; color: #4a2f10; }
span.fm-set-badge { background: #ffd77a; }
.fm-set-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .fm-set-body b { font-size: 13px; } .fm-set-body small { font-size: 11px; color: var(--fm-gold); font-weight: 700; }
.fm-set-bar { position: relative; height: 14px; border-radius: 7px; background: #0b2329; border: 1px solid #ffffff22; overflow: hidden; }
.fm-set-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ffe08f, #f2a83a); border-radius: 7px; }
.fm-set-bar span { position: relative; display: block; text-align: center; font: 800 10px/13px system-ui; color: #fff; text-shadow: 0 1px 1px #000a; }
.fm-set-items { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.fm-set-item { padding: 0; border: 0; background: none; border-radius: 12px; opacity: .55; filter: saturate(.5); }
.fm-set-item.on { opacity: 1; filter: none; outline: 2px solid #ffd77a; outline-offset: 1px; }
.fm-set-item .fm-decor-ic { width: 42px; height: 42px; }
/* Lát nền đợt 2: the tiles themselves as the chips. */
.g-lawn { background: url("assets/farm/ground/ground-lawn.webp?v=mut463-20261127") center / 46px; }
.g-lawn-flowers { background: url("assets/farm/ground/ground-lawn-flowers.webp?v=mut463-20261127") center / 46px; }
.g-path-dirt { background: url("assets/farm/ground/ground-path-dirt.webp?v=mut463-20261127") center / 46px; }
/* Xoay / Cất either side of the selected decor (QA 22/11 GV-02): two round cream buttons, farm.js decorTools places each. */
.fm-decor-tools { position: absolute; inset: 0; pointer-events: none; z-index: 4; animation: fmToolsIn .18s ease-out; }
.fm-decor-tools .fm-dt { position: absolute; translate: -50% -50%; pointer-events: auto; }
.fm-dt { position: relative; width: 54px; height: 54px; border-radius: 50%; border: 3px solid #8a5a2b; background: radial-gradient(circle at 35% 30%, #fffaf0, #f3dfb6 70%); box-shadow: 0 4px 0 #6b4220, 0 6px 12px #0007;
    display: grid; place-items: center; padding: 0; cursor: pointer; }
.fm-dt svg { width: 32px; height: 32px; }
.fm-dt small { position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: #fff6dc; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; }
.fm-dt:active { transform: translateY(3px); box-shadow: 0 1px 0 #6b4220, 0 3px 8px #0007; }
html.short .fm-dt, html.phone .fm-dt { width: 46px; height: 46px; } html.short .fm-dt svg, html.phone .fm-dt svg { width: 27px; height: 27px; }
@keyframes fmToolsIn { from { opacity: 0; } to { opacity: 1; } }
/* Kéo để dời trang trí: a gold diamond on the target cell (red when it is taken). */
.fm-move-mark { position: absolute; width: 74px; height: 42px; transform: translate(-50%, -50%); pointer-events: none; z-index: 3;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: #ffd54acc; box-shadow: inset 0 0 0 3px #fff6c8; }
.fm-move-mark.bad { background: #ff5a4acc; }
.fm-decor-tools.dragging { opacity: 0; } .fm-decor-tools.dragging .fm-dt { pointer-events: none; }
/* Bán from the shop's Túi tab (QA 22/11 GV-02 moved it out of the garden). */
.fm-bagcard { display: flex; flex-direction: column; gap: 4px; } .fm-bagcard .fm-decorcard { flex: 1; } .fm-bag-sell { font-size: 12px; padding: 4px 8px; }

/* Đảo Rồng (the owner 27/11): the island switcher is the same box as on Đảo quân sự / Đảo Vườn (bottom left, a column),
   and Tà Long / Long Ấn / Giao ước are a third row of the right-hand grid (Đập trứng … Thần Khí), the same tiles. */
.dragon-view > .isle-switch:not(:empty) ~ .dragon-top [data-dragon-exit] { display: none; }
.dragon-view > .isle-switch { z-index: 4; }
.dragon-view:has(> .isle-switch:not(:empty)) .dragon-bottom { left: calc(env(safe-area-inset-left, 0px) + 196px); justify-content: flex-end; }
html.short .dragon-view:has(> .isle-switch:not(:empty)) .dragon-bottom, html.phone .dragon-view:has(> .isle-switch:not(:empty)) .dragon-bottom { left: calc(env(safe-area-inset-left, 0px) + 178px); }
html .dragon-actions .dragon-ev { position: relative !important; inset: auto !important; z-index: auto; display: flex !important; flex-direction: column; align-items: center; justify-content: flex-start;
  width: 66px !important; height: 66px !important; min-height: 0 !important; padding: 3px 2px 4px !important; gap: 0 !important; border-radius: 14px !important; overflow: visible; }
html .dragon-actions .dragon-ev .boss-launch-head, html .dragon-actions .dragon-ev .dq-launch-art, html .dragon-actions .dragon-ev .pact-launch-art { width: 30px !important; height: 30px !important; flex: none; font-size: 0; line-height: 0; display: grid; place-items: center; }
html .dragon-actions .dragon-ev .boss-launch-head :is(img, svg), html .dragon-actions .dragon-ev .pact-launch-art svg { width: 30px !important; height: 30px !important; }
html .dragon-actions .dragon-ev b { font-size: 10.5px !important; line-height: 1.1 !important; margin-top: 1px; white-space: nowrap; }
html .dragon-actions .dragon-ev small { max-width: 100%; font-size: 8.5px !important; font-weight: 800; line-height: 1.1 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html .dragon-actions .dragon-ev .dq-badge { position: absolute; top: -5px; right: -5px; }
/* Tà Long live: red, glowing, its "ĐANG DIỄN RA" bright */
html .dragon-actions .boss-launch.dragon-ev.is-live { border-color: #ff5a3a !important; background: radial-gradient(circle at 50% 30%, #a8261a, #4a0d12) !important; }
html .dragon-actions .boss-launch.dragon-ev.is-live small { color: #ffd0b8; }
/* a phone held sideways (844 × 390): smaller tiles and the grid a little higher, so its three rows stay above Cho ăn hàng loạt */
html.short .dragon-actions, html.phone .dragon-actions { top: 50px !important; gap: 4px !important; grid-template-columns: repeat(3, 58px) !important; }
html.short .dragon-actions button, html.phone .dragon-actions button { width: 58px !important; height: 58px !important; }
html.short .dragon-actions .dragon-ev, html.phone .dragon-actions .dragon-ev { width: 58px !important; height: 58px !important; }
html.short .dragon-actions .isle-ic, html.phone .dragon-actions .isle-ic { width: 30px; height: 30px; }
html.short .dragon-actions .dragon-ev :is(.boss-launch-head, .dq-launch-art, .pact-launch-art), html.phone .dragon-actions .dragon-ev :is(.boss-launch-head, .dq-launch-art, .pact-launch-art) { width: 26px !important; height: 26px !important; }
html.short .dragon-actions .dragon-ev .boss-launch-head :is(img, svg), html.short .dragon-actions .dragon-ev .pact-launch-art svg { width: 26px !important; height: 26px !important; }
/* Đảo Rồng (the owner 27/11 23:35, dragon-quick moved): Rồng của tôi / Dung hợp / Đội hình / Leo hạng were a row along the bottom
   and the island switcher covered "Rồng của tôi" on an iPhone (browser bar on the left); now a column on the left between the
   title and the switcher, as wide as the switcher. The bottom keeps only the switcher (left) and Ải Viễn Chinh (right). */
html .dragon-view > .dragon-quick { position: absolute; left: calc(env(safe-area-inset-left, 0px) + 12px); right: auto; top: 60px; bottom: auto; z-index: 3; width: 184px;
  max-height: calc(100% - 60px - 150px); display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
html .dragon-view > .dragon-quick button { flex: 1 1 44px; width: 100% !important; min-height: 28px; max-height: 44px; height: auto !important; justify-content: flex-start; padding: 0 10px 0 6px !important; }
html .dragon-view > .dragon-quick button .isle-ic { width: 30px; height: 30px; flex: none; }
html.short .dragon-view > .dragon-quick, html.phone .dragon-view > .dragon-quick { left: calc(env(safe-area-inset-left, 0px) + 8px); top: 52px; width: 164px; gap: 4px; max-height: calc(100% - 52px - 136px); }
html.short .dragon-view > .dragon-quick button .isle-ic, html.phone .dragon-view > .dragon-quick button .isle-ic { width: 26px; height: 26px; }
html.short .dragon-view > .dragon-quick small, html.phone .dragon-view > .dragon-quick small { font-size: 12px !important; }
.dragon-view:has(> .isle-switch:not(:empty)) .dragon-bottom { left: auto !important; }

html .dragon-view .dragon-hint { max-width: calc(100% - 2 * (env(safe-area-inset-left, 0px) + 190px)); overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 360px) { html.app-look .dragon-view .dragon-actions, html.short .dragon-view .dragon-actions { top: 46px !important; grid-template-columns: repeat(3, 52px) !important; } html.short .dragon-view .dragon-actions button, html.app-look .dragon-view .dragon-actions button { width: 52px !important; height: 52px !important; } html .dragon-actions .isle-ic { width: 26px; height: 26px; } html .dragon-view > .dragon-quick { top: 48px; max-height: calc(100% - 48px - 132px); } }
@media (max-height: 360px) { html.short .dragon-view .dragon-actions .dragon-ev :is(.boss-launch-head, .dq-launch-art, .pact-launch-art), html.app-look .dragon-view .dragon-actions .dragon-ev :is(.boss-launch-head, .dq-launch-art, .pact-launch-art) { width: 22px !important; height: 22px !important; } html.app-look .dragon-view .dragon-actions .dragon-ev :is(.boss-launch-head img, .boss-launch-head svg, .pact-launch-art svg) { width: 22px !important; height: 22px !important; } html.app-look .dragon-view .dragon-actions small { font-size: 8.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } html.app-look .dragon-view .dragon-actions .dragon-ev b { font-size: 9.5px !important; } html.app-look .dragon-view .dragon-actions .dragon-ev small { font-size: 8px !important; } }

/* ---- Đảo Vườn v2 (docs/Dac_ta_thiet_ke_Dao_Vuon_DragonBum_v2.docx mục 04, 05, 06, 08, 09) --------------------------- */
/* Camera row (MAP-02): zoom, ⟲ ⟳, Về giữa, Xem toàn đảo — bottom middle, between the island switcher and Thu hoạch. */
.fm-cam { position: absolute; left: 50%; bottom: 12px; translate: -50% 0; gap: 6px; align-items: center; padding: 4px; border-radius: 14px; background: #0e2f37cc; border: 1px solid #ffffff1c; box-shadow: 0 4px 12px #0005; }
.fm-cam button { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; border-radius: 11px; border: 1px solid #ffffff22; background: #123841; color: var(--fm-text); font-size: 20px; font-weight: 800; line-height: 1; }
.fm-cam button.wide { font-size: 12px; } .fm-cam button.wide b { font-size: 17px; }
.fm-cam button:active { translate: 0 1px; background: #1b4a55; }
#farm-hud:has(#farm-tray:not([hidden])) .fm-cam, body.decor-on #farm-hud .fm-cam { display: none !important; }
html.short .fm-cam, html.phone .fm-cam { bottom: 6px; gap: 4px; padding: 3px; }
html.short .fm-cam button, html.phone .fm-cam button { min-width: 40px; height: 40px; font-size: 18px; padding: 0 6px; }
html.short .fm-cam button.wide span, html.phone .fm-cam button.wide span { font-size: 11px; }
/* Xong (FARM-03): the big way out of sow / harvest / water. */
.fm-done { min-width: 76px; min-height: 48px; padding: 0 16px !important; border-radius: 14px !important; border: 2px solid #2f6d1e !important; background: linear-gradient(#8fe06a, #5cbf3e) !important; color: #173a0c !important; font-size: 17px !important; font-weight: 900 !important; justify-content: center; box-shadow: 0 3px 0 #2f6d1e; }
html.short .fm-done, html.phone .fm-done { min-width: 64px; min-height: 44px; font-size: 15px !important; }
/* Swipe count and the ✕ on skipped fields. */
.fm-count { position: absolute; left: 50%; top: 64px; translate: -50% 0; padding: 6px 14px; border-radius: 999px; background: #092c36ee; border: 1px solid #ffcd6988; color: #fff3d0; font-size: 15px; pointer-events: none !important; white-space: nowrap; box-shadow: 0 4px 12px #0006; }
.fm-count b { color: #ffe08f; } .fm-count small { color: #a1b9b9; } .fm-count-x { color: #ff9a8a; font-size: 13px; margin-left: 6px; }
.fm-count[hidden] { display: none; }
html.short .fm-count, html.phone .fm-count { top: 50px; font-size: 13px; padding: 4px 10px; }
.fm-x { position: absolute; translate: -50% -50%; width: 26px; height: 26px; border-radius: 50%; background: #e8463aee; color: #fff; font: 900 15px/26px system-ui; text-align: center; box-shadow: 0 2px 6px #0007; pointer-events: none; }
/* Mở đất (LAND-02): a card at the bottom on wide screens, a bottom sheet on phones; the region stays visible above it. */
.fm-sheet { position: absolute; left: 50%; bottom: 12px; translate: -50% 0; width: min(420px, calc(100% - 24px)); padding: 14px 16px 12px; border-radius: 18px; background: #123841f5; border: 2px solid #ffcd6966; color: var(--fm-text); box-shadow: 0 10px 30px #000a; z-index: 3; }
.fm-sheet[hidden] { display: none; }
.fm-sheet h3 { display: flex; align-items: center; gap: 8px; margin: 0 30px 2px 0; font-size: 18px; }
.fm-sheet-sub { margin: 0 0 8px; color: #a1b9b9; font-size: 13px; }
.fm-sheet-rows { display: flex; flex-direction: column; gap: 4px; } .fm-sheet-rows .fm-pop-row { width: 100%; box-sizing: border-box; }
.fm-sheet-why { margin: 8px 0 0; padding: 6px 10px; border-radius: 10px; background: #5a1f1f99; color: #ffd2c8; font-size: 13px; }
.fm-sheet-ok { margin: 8px 0 0; color: #8fe06a; font-size: 13px; }
.fm-sheet .fm-pop-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; } .fm-sheet .fm-pop-btns button { min-height: 44px; }
.fm-sheet-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid #ffffff33; background: #0b2a31; color: #fff; font-size: 15px; }
html.short .fm-sheet, html.phone .fm-sheet { left: 0; right: 0; bottom: 0; translate: none; width: auto; max-width: none; border-radius: 18px 18px 0 0; border-bottom: 0; padding: 10px 14px calc(8px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: 1fr auto; column-gap: 14px; align-items: center; }
html.short .fm-sheet:not([hidden]), html.phone .fm-sheet:not([hidden]) { display: grid; }
html.short .fm-sheet h3, html.phone .fm-sheet h3 { font-size: 15px; grid-column: 1; } html.short .fm-sheet-sub, html.phone .fm-sheet-sub { grid-column: 1; margin-bottom: 4px; font-size: 12px; }
html.short .fm-sheet-rows, html.phone .fm-sheet-rows { grid-column: 1; flex-direction: row; } html.short .fm-sheet-rows .fm-pop-row, html.phone .fm-sheet-rows .fm-pop-row { padding: 4px 10px; font-size: 13px; gap: 12px; }
html.short .fm-sheet-why, html.short .fm-sheet-ok, html.phone .fm-sheet-why, html.phone .fm-sheet-ok { grid-column: 1; margin-top: 4px; font-size: 12px; }
html.short .fm-sheet .fm-pop-btns, html.phone .fm-sheet .fm-pop-btns { grid-column: 2; grid-row: 1 / span 4; flex-direction: column; margin: 0 34px 0 0; }
body:has(#farm-sheet:not([hidden])) #farm-hud .fm-cam, body:has(#farm-sheet:not([hidden])) #farm-hud .fm-all { display: none !important; }
/* Quy hoạch (mục 09): its own bar at the bottom; the farm's other buttons step aside until Lưu or Huỷ. */
body.plan-on #farm-hud .fm-side, body.plan-on #farm-hud .fm-ripe, body.plan-on #farm-hud .fm-all, body.plan-on #farm-hud .fm-tray, body.plan-on .isle-switch, body.plan-on #decor-bar { display: none !important; }
body.plan-on #farm-hud .fm-cam { bottom: auto; top: 58px; left: auto; right: calc(env(safe-area-inset-right, 0px) + 12px); translate: none; flex-direction: column; }
html.short body.plan-on #farm-hud .fm-cam, html.phone body.plan-on #farm-hud .fm-cam { top: 50px; flex-direction: row; flex-wrap: wrap; width: 92px; justify-content: center; }
html.short body.plan-on .fm-cam button.wide span, html.phone body.plan-on .fm-cam button.wide span { display: none; }
.fm-plan { position: absolute; left: 50%; bottom: 10px; translate: -50% 0; width: min(860px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.fm-plan[hidden] { display: none; }
.fm-plan-row, .fm-plan-sel, .fm-plan-bag { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 16px; background: #123841f5; border: 2px solid #ffcd6966; color: var(--fm-text); box-shadow: 0 8px 20px #0007; }
.fm-plan-row button, .fm-plan-sel button { flex: none; width: auto; min-width: 0; min-height: 44px; margin: 0; padding: 0 12px; border-radius: 11px; font-weight: 800; font-size: 13px; white-space: nowrap; }
.fm-plan-row [data-plan="save"] { min-width: 84px; }
.fm-plan-row button.on { outline: 2px solid var(--fm-gold); }
.fm-plan-t { font-size: 15px; color: var(--fm-gold); white-space: nowrap; } .fm-plan-n { flex: 1; color: #a1b9b9; font-size: 12px; text-align: center; min-width: 0; }
.fm-plan-sel .fm-decor-ic { flex: none; width: 40px; height: 40px; }
.fm-plan-sel > span:not(.fm-decor-ic) { display: flex; flex-direction: column; flex: 1; line-height: 1.25; min-width: 0; } .fm-plan-sel small { color: #a1b9b9; font-size: 11px; }
.fm-plan-bag { overflow-x: auto; overscroll-behavior: contain; }
.fm-plan-bagitem { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 84px; padding: 6px 4px; border-radius: 12px; border: 1px solid #ffffff22; background: #0b2a31; color: var(--fm-text); }
.fm-plan-bagitem.on { outline: 2px solid var(--fm-gold); } .fm-plan-bagitem b { position: absolute; top: 2px; right: 6px; font-size: 12px; color: var(--fm-gold); }
.fm-plan-bagitem small { font-size: 10px; line-height: 1.15; text-align: center; max-height: 2.3em; overflow: hidden; }
.fm-plan-empty { margin: 0; color: #a1b9b9; font-size: 13px; }
.fm-plan-why { position: absolute; translate: 14px -130%; padding: 4px 10px; border-radius: 10px; background: #8a1f17ee; color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none; z-index: 4; }
html.short .fm-plan, html.phone .fm-plan { bottom: 4px; width: calc(100% - 12px); gap: 4px; }
html.short .fm-plan-row, html.short .fm-plan-sel, html.short .fm-plan-bag, html.phone .fm-plan-row, html.phone .fm-plan-sel, html.phone .fm-plan-bag { padding: 4px 6px; gap: 5px; border-width: 1px; border-radius: 12px; }
html.short .fm-plan-row button, html.short .fm-plan-sel button, html.phone .fm-plan-row button, html.phone .fm-plan-sel button { min-height: 40px; padding: 0 8px; font-size: 12px; }
html.short .fm-plan-t, html.phone .fm-plan-t { display: none; }
html.short .fm-plan-bagitem, html.phone .fm-plan-bagitem { width: 62px; padding: 3px; } html.short .fm-plan-bagitem .fm-decor-ic, html.phone .fm-plan-bagitem .fm-decor-ic { width: 32px; height: 32px; } html.short .fm-plan-bagitem small, html.phone .fm-plan-bagitem small { font-size: 9px; }
html.short .fm-plan-sel .fm-decor-ic, html.phone .fm-plan-sel .fm-decor-ic { width: 32px; height: 32px; }
/* Sắp ra mắt (decor `soon`): in the shop, not for sale yet. */
.fm-decorcard.soon { position: relative; opacity: .75; filter: grayscale(.35); }
.fm-soon { position: absolute; top: 6px; left: 6px; padding: 2px 7px; border-radius: 8px; background: #e8a23a; color: #3a2008; font-size: 10px; font-weight: 900; font-style: normal; }
html.short body:has(#farm-sheet:not([hidden])) .isle-switch, html.phone body:has(#farm-sheet:not([hidden])) .isle-switch,
html.short body:has(#farm-sheet:not([hidden])) #farm-hud .fm-side, html.phone body:has(#farm-sheet:not([hidden])) #farm-hud .fm-side { display: none !important; }
.fm-sheet-rows .fm-pop-row { margin: 0; }

/* ---- V2.1 (30/11, đặc tả điều chỉnh Đảo Vườn) ------------------------------------------------------------------------ */
/* NOTIFY-01: a short note next to the action (one at a time; the same note again just bumps) */
.fm-note-pop { position: absolute; z-index: 9; translate: -50% calc(-100% - 10px); display: flex; align-items: center; gap: 8px; max-width: min(340px, calc(100% - 24px)); padding: 7px 8px 7px 12px; border-radius: 12px; background: #3a1f12f2; border: 1px solid #ffb27a88; color: #fff1e2; font-size: 13px; font-weight: 700; line-height: 1.3; box-shadow: 0 6px 18px #0008; pointer-events: auto; animation: fmNoteIn .16s ease-out; }
.fm-note-pop[hidden] { display: none; }
.fm-note-pop.bad { background: #4a1616f2; border-color: #ff8a7a99; }
.fm-note-pop.bump { animation: fmNoteBump .25s ease-out; }
.fm-note-pop button[data-note-btn] { flex: none; padding: 6px 10px; border-radius: 10px; border: 0; background: linear-gradient(#ffe08f, #ffcd69); color: #4a2f10; font-weight: 800; font-size: 12px; white-space: nowrap; min-height: 32px; }
.fm-note-pop .fm-note-x { flex: none; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 0; background: #ffffff1f; color: #fff; font-size: 12px; }
@keyframes fmNoteIn { from { opacity: 0; translate: -50% calc(-100% - 2px); } }
@keyframes fmNoteBump { 40% { scale: 1.06; } }
.fm-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* a yes / no beside a purchase or a bulk paint */
.fm-confirm { position: absolute; z-index: 9; translate: -50% calc(-100% - 12px); display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 190px; max-width: min(320px, calc(100% - 24px)); padding: 10px 12px; border-radius: 14px; background: #123841f8; border: 2px solid #ffcd69aa; color: var(--fm-text); box-shadow: 0 8px 22px #000a; pointer-events: auto; text-align: center; }
.fm-confirm[hidden] { display: none; }
.fm-confirm b { font-size: 14px; } .fm-confirm-cost { color: #ffe08f; font-weight: 800; font-size: 13px; }
.fm-confirm div { display: flex; gap: 8px; margin-top: 4px; } .fm-confirm button { min-height: 40px; min-width: 76px; padding: 6px 14px; border-radius: 12px; font-weight: 800; }
/* CROP-ART-01: the short card of a growing crop */
.fm-bubble .fm-crop-card { display: flex; align-items: center; gap: 8px; text-align: left; white-space: normal; min-width: 170px; max-width: 250px; }
.fm-crop-card > div { display: flex; flex-direction: column; } .fm-crop-card small { color: #cfe3df; font-size: 11.5px; }
/* FARM-UX-01: crops not sowable yet */
.fm-slot.locked .fi { filter: grayscale(1) brightness(.7); }
.fm-slot.off .fm-price, .fm-slot.locked .fm-price { color: #ffd2c8; }
/* LAND-01: the small region sheet (one state) */
.fm-sheet { width: min(340px, calc(100% - 24px)); padding: 10px 14px 12px; }
.fm-sheet h3 { font-size: 16px; } .fm-sheet-sub { margin: 0 0 4px; }
.fm-sheet-buy { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.fm-sheet-price { font-size: 17px; font-weight: 800; color: #ffe08f; } .fm-sheet-buy button { min-height: 44px; padding: 8px 18px; border-radius: 12px; font-weight: 800; }
html.short .fm-sheet, html.phone .fm-sheet { bottom: 8px; padding: 8px 12px 10px; }
/* Dời above a selected piece */
.fm-dt-move svg { width: 30px; height: 30px; }
/* DECOR-UX-01: Cửa hàng & Kho, a low tray at the bottom */
.fm-dtray { position: absolute; left: calc(env(safe-area-inset-left, 0px) + 12px); right: calc(env(safe-area-inset-right, 0px) + 12px); bottom: 8px; z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 16px; background: #123841f4; border: 2px solid #ffcd6966; color: var(--fm-text); box-shadow: 0 8px 26px #0009; pointer-events: auto; }
.fm-dtray[hidden] { display: none; }
body.dtray-on .isle-switch, body.dtray-on #farm-hud .fm-all, body.dtray-on #farm-hud .fm-tray { visibility: hidden; }
.fm-dt-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fm-dt-head .fm-dt-filter { flex: 1 1 auto; min-width: 60px; }
.fm-dt-title { display: flex; align-items: center; gap: 6px; font-size: 15px; white-space: nowrap; }
.fm-dt-head .fm-dt-beauty { display: flex; align-items: center; gap: 3px; color: #ffe08f; white-space: nowrap; }
.fm-dt-head .quiet { flex: none; padding: 5px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; min-height: 32px; }
.fm-dt-head .fm-tray-x { flex: none; }
.fm-dt-tabs { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fm-dt-tab, .fm-dt-filter { display: flex; gap: 5px; flex: none; }
.fm-dt-filter { flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; } .fm-dt-filter::-webkit-scrollbar { display: none; }
.fm-dt-tab button, .fm-dt-filter button { flex: none; min-height: 32px; padding: 4px 11px; border-radius: 10px; border: 1px solid #ffffff22; background: #1b4650; color: var(--fm-text); font-weight: 700; font-size: 12px; white-space: nowrap; }
.fm-dt-tab button.on { background: linear-gradient(#ffe08f, #ffcd69); color: #4a2f10; border-color: transparent; }
.fm-dt-filter button { border-radius: 999px; background: #0e2f37; } .fm-dt-filter button.on { background: #2f7d5a; border-color: #8fe06a88; }
.fm-dt-sets { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; font-size: 11px; } .fm-dt-sets span { flex: none; padding: 2px 8px; border-radius: 999px; background: #0e2f37; color: #cfe3df; } .fm-dt-sets span.done { background: #2f7d5a; color: #fff; }
.fm-drow { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 2px 2px 4px; touch-action: pan-y; }
.fm-drow::-webkit-scrollbar { display: none; }
.fm-dcell { flex: none; display: flex; flex-direction: column; gap: 3px; }
.fm-dcard { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 112px; padding: 6px 4px 5px; border-radius: 12px; border: 1px solid #ffffff1a; background: #173f49; color: var(--fm-text); text-align: center; touch-action: none; }
.fm-dcard.have { border-color: #8fe06a88; background: #1b4a3f; }
.fm-dcard.soon { opacity: .55; }
.fm-dcard b { font-size: 12px; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-dcard .fm-dc-meta { color: #a1b9b9; font-size: 10.5px; display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.fm-dcard .fm-dc-price { color: #ffe08f; font-size: 11px; font-weight: 800; white-space: nowrap; }
.fm-dcard .fm-dc-n { position: absolute; top: 4px; right: 6px; padding: 0 6px; border-radius: 999px; background: #2f7d5a; color: #fff; font-style: normal; font-weight: 800; font-size: 11px; }
.fm-dcard .fm-decor-ic, .fm-dcard .fm-ground { width: 44px; height: 44px; }
.fm-dcell .fm-bag-sell { min-height: 28px; padding: 2px 6px; border-radius: 8px; font-size: 11px; }
.fm-dt-empty { margin: 8px 4px; color: #a1b9b9; font-size: 13px; }
html.short .fm-dtray, html.phone .fm-dtray { left: calc(env(safe-area-inset-left, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px); bottom: 6px; gap: 4px; padding: 5px 8px; }
html.short .fm-dt-head, html.phone .fm-dt-head { gap: 5px; } html.short .fm-dt-title .fi, html.phone .fm-dt-title .fi { display: none; }
html.short .fm-dcell .fm-bag-sell, html.phone .fm-dcell .fm-bag-sell { min-height: 24px; padding: 1px 4px; font-size: 10.5px; }
html.short .fm-dt-head .fm-tray-x, html.phone .fm-dt-head .fm-tray-x { width: 30px; height: 30px; }
html.short .fm-dt-title, html.phone .fm-dt-title { font-size: 13px; }
html.short .fm-dcard, html.phone .fm-dcard { width: 96px; padding: 4px 3px; }
html.short .fm-dcard .fm-decor-ic, html.short .fm-dcard .fm-ground, html.phone .fm-dcard .fm-decor-ic, html.phone .fm-dcard .fm-ground { width: 34px; height: 34px; }
html.short .fm-dt-tab button, html.short .fm-dt-filter button, html.phone .fm-dt-tab button, html.phone .fm-dt-filter button { min-height: 28px; padding: 2px 9px; font-size: 11px; }
html.short .fm-dt-head .quiet, html.phone .fm-dt-head .quiet { min-height: 28px; padding: 3px 8px; font-size: 11px; }

/* ---- Đảo Vườn V2.1 Đợt 2: the design team's UI kit (assets/farm/v2/ui, ui-atlas-manifest.json) ----------------------
   WebP 1× / @2x. ui_tray_bg (360 × 96) and ui_sheet_bg (420 × 180) are 9-slice frames, 16 px each side at 1×, 32 px at @2x,
   so the border image swaps by screen density with the slice doubled; the 72 px slots and the badges are drawn at size.
   Sprites of 24–40 px sit inside buttons whose hit area is at least 44 px (a ::before pad where the button is drawn smaller). */
:root { --fk-ink: #4a2f10; --fk-ink2: #7a5a32; --fk-cream: #f8ecd0; --fk-line: #8a5a2b; }
.fu { position: static !important; inset: auto !important; translate: none !important; display: inline-block; -webkit-user-drag: none; user-select: none; }
.fu { flex: none; vertical-align: middle; object-fit: contain; pointer-events: none; }
.fm-tray, .fm-dtray { border: 16px solid transparent; border-image: url("assets/farm/v2/ui/ui_tray_bg.webp?v=dv21d2-20261130") 16 fill / 16px; background: none; box-shadow: none; filter: drop-shadow(0 6px 12px #0006); color: var(--fk-ink); }
.fm-sheet, .fm-bubble:has(> .fm-crop-card) { border: 16px solid transparent; border-image: url("assets/farm/v2/ui/ui_sheet_bg.webp?v=dv21d2-20261130") 16 fill / 16px; background: none; box-shadow: none; filter: drop-shadow(0 8px 16px #0007); color: var(--fk-ink); }
@media (min-resolution: 1.5dppx) {
  .fm-tray, .fm-dtray { border-image: url("assets/farm/v2/ui/ui_tray_bg@2x.webp?v=dv21d2-20261130") 32 fill / 16px; }
  .fm-sheet, .fm-bubble:has(> .fm-crop-card) { border-image: url("assets/farm/v2/ui/ui_sheet_bg@2x.webp?v=dv21d2-20261130") 32 fill / 16px; }
}
/* Seed tray (khay-hat mockup): cream tray, ui_tray_slot bags, ui_tray_slot_on for the armed one, ui_badge_count numbers. */
.fm-tray { padding: 0 2px; gap: 10px; }
html.short .fm-tray, html.phone .fm-tray { padding: 0; border-width: 12px; border-image-width: 12px; }
.fm-slot { width: 72px; height: 72px; padding: 0 0 14px; border: 0; border-radius: 11px; background: url("assets/farm/v2/ui/ui_tray_slot.webp?v=dv21d2-20261130") center / 100% 100% no-repeat; color: var(--fk-ink); }
.fm-slot.on { border: 0; box-shadow: 0 0 12px #ffcd69cc; background-image: url("assets/farm/v2/ui/ui_tray_slot_on.webp?v=dv21d2-20261130"); }
@media (min-resolution: 1.5dppx) { .fm-slot { background-image: url("assets/farm/v2/ui/ui_tray_slot@2x.webp?v=dv21d2-20261130"); } .fm-slot.on { background-image: url("assets/farm/v2/ui/ui_tray_slot_on@2x.webp?v=dv21d2-20261130"); } }
.fm-slot .fm-name { bottom: 3px; color: var(--fk-ink); font-size: 10px; font-weight: 800; }
.fm-n { right: 3px; bottom: 16px; min-width: 28px; height: 20px; box-sizing: border-box; padding: 0 4px; display: grid; place-items: center; font: 800 12px/1 system-ui; color: var(--fk-ink); text-shadow: none; background: url("assets/farm/v2/ui/ui_badge_count.webp?v=dv21d2-20261130") center / 100% 100% no-repeat; }
@media (min-resolution: 1.5dppx) { .fm-n { background-image: url("assets/farm/v2/ui/ui_badge_count@2x.webp?v=dv21d2-20261130"); } }
.fm-badge { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; font-style: normal; line-height: 0; }
.fm-slot.off .fm-badge { opacity: 1; }
.fm-slot.empty .fm-n { opacity: .75; }
.fm-tray-side button { min-height: 44px; border: 2px solid var(--fk-line); background: linear-gradient(#fff6df, #f1dcae); color: var(--fk-ink); }
.fm-done { gap: 6px; border: 2px solid var(--fk-line) !important; background: linear-gradient(#ffe9b0, #f3c66b) !important; color: var(--fk-ink) !important; box-shadow: 0 3px 0 #a8723c !important; }
.fm-tool-hint { color: var(--fk-ink); }
.fm-tray-hint { top: -40px; }
html.short .fm-tray-hint, html.phone .fm-tray-hint { top: -34px; }
html.short .fm-slot, html.phone .fm-slot { width: 58px; height: 58px; padding-bottom: 12px; }
html.short .fm-slot .fm-name, html.phone .fm-slot .fm-name { font-size: 9px; bottom: 2px; }
html.short .fm-n, html.phone .fm-n { bottom: 13px; min-width: 24px; height: 17px; font-size: 11px; }
/* Region sheet (vung-khoa mockup) and the crop card (the-cay mockup): ui_sheet_bg, dark ink on cream. */
.fm-sheet { padding: 2px 6px 0; }
.fm-sheet h3 { color: var(--fk-ink); }
.fm-sheet-sub { display: flex; align-items: center; gap: 4px; color: var(--fk-ink2); }
.fm-sheet-price { color: #7a4a12; }
.fm-sheet-why { background: #f3d2c4; color: #7a2a1a; }
.fm-sheet-buy button { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; border: 2px solid var(--fk-line); background: linear-gradient(#ffe9b0, #f3c66b); color: var(--fk-ink); box-shadow: 0 3px 0 #a8723c; }
.fm-sheet-x { border: 2px solid var(--fk-line); background: #fff6df; color: var(--fk-ink); }
.fm-sheet-x::before, .fm-tray-x::before, .fm-dt-tab button::before, .fm-dt-filter button::before, .fm-dt-head .quiet::before { content: ''; position: absolute; inset: -6px -2px; }
.fm-tray-x, .fm-dt-tab button, .fm-dt-filter button, .fm-dt-head .quiet { position: relative; }
html.short .fm-sheet, html.phone .fm-sheet { left: calc(env(safe-area-inset-left, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px); bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); border-style: solid; border-color: transparent; border-width: 12px; border-image-width: 12px; padding: 0 4px; }
.fm-bubble:has(> .fm-crop-card) { padding: 0 4px; border-radius: 0; }
.fm-bubble:has(> .fm-crop-card)::after { bottom: -12px; border-top-color: #e9d3a2; }
.fm-crop-card b { color: var(--fk-ink); font-size: 13px; }
.fm-crop-card small { display: flex; align-items: center; gap: 4px; color: var(--fk-ink2) !important; }
/* Cửa hàng & Kho (kho-trang-tri mockup): tabs with ic_tab_*, filters with ic_filter_*, cream cards with ui_badge_count. */
.fm-dtray { padding: 0 2px; gap: 6px; }
html.short .fm-dtray, html.phone .fm-dtray { padding: 0; border-width: 12px; border-image-width: 12px; gap: 4px; }
.fm-dt-title { color: var(--fk-ink); }
.fm-dt-tab button, .fm-dt-filter button { display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 2px 11px 2px 6px; border: 2px solid #c9a56e; background: #fff8e6; color: var(--fk-ink); }
.fm-dt-tab button.on { background: #d6e8b8; border-color: #6f9a3e; color: #2c4a12; }
.fm-dt-filter button.on { background: #d6e8b8; border-color: #6f9a3e; color: #2c4a12; }
.fm-dt-head .quiet { border: 2px solid #c9a56e; background: #fff8e6; color: var(--fk-ink); min-height: 38px; }
.fm-dt-head .fm-dt-beauty { color: #7a4a12; }
.fm-dt-head .fm-tray-x { width: 38px; height: 38px; background: #fff6df !important; color: var(--fk-ink) !important; border: 2px solid var(--fk-line) !important; }
.fm-dt-sets span { background: #efe0bd; color: var(--fk-ink); } .fm-dt-sets span.done { background: #6f9a3e; color: #fff; }
.fm-dcard { border: 2px solid #d9bd8a; background: #fffaf0; color: var(--fk-ink); }
.fm-dcard.have { border-color: #b98a4e; background: #fff4dc; }
.fm-dcard .fm-dc-meta { color: var(--fk-ink2); gap: 3px; }
.fm-dcard .fm-dc-price { color: #7a4a12; }
.fm-dcard .fm-dc-n { top: 3px; right: 4px; min-width: 28px; height: 20px; box-sizing: border-box; padding: 0 4px; display: grid; place-items: center; border-radius: 0; color: var(--fk-ink); background: url("assets/farm/v2/ui/ui_badge_count.webp?v=dv21d2-20261130") center / 100% 100% no-repeat; }
@media (min-resolution: 1.5dppx) { .fm-dcard .fm-dc-n { background-image: url("assets/farm/v2/ui/ui_badge_count@2x.webp?v=dv21d2-20261130"); } }
.fm-dcard .fm-dc-lock { position: absolute; top: 3px; left: 4px; width: 20px; height: 20px; line-height: 0; }
.fm-dcell .fm-bag-sell { min-height: 36px; }
.fm-dt-empty { color: var(--fk-ink2); }
html.short .fm-dt-tab button, html.short .fm-dt-filter button, html.phone .fm-dt-tab button, html.phone .fm-dt-filter button { min-height: 32px; padding: 1px 8px 1px 4px; }
html.short .fm-dt-tab .fu, html.short .fm-dt-filter .fu, html.phone .fm-dt-tab .fu, html.phone .fm-dt-filter .fu { width: 18px !important; height: 18px !important; }
html.short .fm-dt-head .quiet, html.phone .fm-dt-head .quiet { min-height: 32px; }
html.short .fm-dt-head .fm-tray-x, html.phone .fm-dt-head .fm-tray-x { width: 32px; height: 32px; }
/* Decor tools round a selected piece: the kit's ic_rotate / ic_move / ic_store / ic_done (48 px art in 54 / 46 px buttons). */
.fm-dt .fu { width: 32px; height: 32px; }
html.short .fm-dt .fu, html.phone .fm-dt .fu { width: 28px !important; height: 28px !important; }
.fm-dt-done { background: radial-gradient(circle at 35% 30%, #f3ffe8, #cfe8b0 70%); border-color: #4f7a2a; }
.fm-note-pop button[data-note-btn] { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; }
