/* Bản 18.6 — Vườn VIE dạng game toàn màn hình. Khung cảnh luôn tươi sáng (không đổi theo giao diện sáng/tối của site).
   .gd-* / .p-* = phần vẽ dùng chung (assets/garden-draw.js), cũng dùng ở trang quản trị (xem trước cây). .gm-* = giao diện game. */

/* ===================== Phần vẽ dùng chung ===================== */
.gd-bld { cursor: pointer; transition: filter .2s; }
.gd-bld:hover, .gd-bld.is-hl { filter: brightness(1.12) drop-shadow(0 0 6px rgba(255, 255, 255, .8)); outline: none; }
.gd-lbl { pointer-events: none; }
.gd-cloud { animation: gdCloud linear infinite; }
@keyframes gdCloud { from { transform: translateX(-160px); } to { transform: translateX(1100px); } }
.gd-star { animation: twinkleStar 3s ease-in-out infinite alternate; }
@keyframes twinkleStar { from { opacity: .25; } to { opacity: 1; } }
.gd-ffly { animation: gdFly 4s ease-in-out infinite alternate; }
@keyframes gdFly { 0% { opacity: .1; transform: translate(0, 0); } 50% { opacity: 1; } 100% { opacity: .2; transform: translate(14px, -10px); } }
.gd-bfly { animation: gdFlap .25s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes gdFlap { to { transform: scaleX(.35); } }
.gd-tree { animation: flutter 5s ease-in-out infinite alternate; transform-box: view-box; }
.gd-lamp { animation: glow 2s ease-in-out infinite alternate; }
.gd-flag { transition: transform .3s; transform-box: fill-box; }
.gd-flag.up rect:last-child { animation: glow 1.2s ease-in-out infinite alternate; }

.gd-plot { position: absolute; width: 160px; height: 160px; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; pointer-events: none; }
.gd-hit { position: absolute; inset: 0; pointer-events: auto; clip-path: polygon(50% 10%, 90% 60%, 90% 76%, 50% 100%, 10% 76%, 10% 60%); }
.gd-plot:focus-visible { outline: none; }
.gd-plot:focus-visible .gd-bed, .gd-plot.is-sel .gd-bed { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 6px #fff7b0); }
.gd-plot.is-sel .gd-bed { animation: gdSel 1.2s ease-in-out infinite alternate; }
@keyframes gdSel { from { filter: drop-shadow(0 0 2px #fff7b0); } to { filter: drop-shadow(0 0 12px #fff7b0) brightness(1.08); } }
.gd-bed { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gd-plant { position: absolute; left: -9%; top: -29%; width: 118%; height: 118%; pointer-events: none; }
.gd-plant > svg { width: 100%; height: 100%; display: block; overflow: visible; }
.gd-plant .p-img.is-bare { position: absolute; left: 50%; bottom: 14%; width: 72%; height: 84%; object-fit: contain; object-position: center bottom; translate: -50% 0; transform-origin: 50% 100%; }
.gd-bubs { position: absolute; left: 50%; top: -24%; translate: -50% 0; display: flex; gap: 3px; pointer-events: none; }
.gd-bub { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); animation: gdBob 1.6s ease-in-out infinite alternate; }
.gd-bub svg { width: 74%; height: 74%; }
.gd-bub-pest { animation: wig 1.2s ease-in-out infinite; }
.gd-bub-ripe { background: #fff7cf; border-color: #ffc533; }
@keyframes gdBob { to { transform: translateY(-5px); } }
@keyframes wig { 0%, 100% { transform: rotate(-8deg); } 50% { transform: translate(-2px, 1px) rotate(8deg); } }

.gd-drop { position: absolute; width: 7px; height: 14px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #4fb3ff; animation: gdDrop .9s ease-in forwards; opacity: 0; }
@keyframes gdDrop { 0% { opacity: 1; transform: translateY(-40px); } 100% { opacity: 0; transform: translateY(60px); } }
.gd-spark { position: absolute; width: 14px; height: 14px; background: radial-gradient(circle, #fff9c4 0 30%, #ffc533 60%, transparent 70%); border-radius: 50%; animation: gdSpark 1.2s ease-out forwards; opacity: 0; }
@keyframes gdSpark { 0% { opacity: 1; transform: scale(.4); } 100% { opacity: 0; transform: translateY(-50px) scale(1.4); } }

.p-sway { transform-origin: 50px 86px; transform-box: view-box; animation: sway 4.6s ease-in-out infinite alternate; }
.p-dry { transform-origin: 50px 86px; transform-box: view-box; transform: rotate(3deg); filter: saturate(.55); }
@keyframes sway { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
.p-leaf { transform-box: view-box; animation: flutter 3.2s ease-in-out infinite alternate; }
.p-leaf2 { animation-delay: -1.6s; }
@keyframes flutter { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.p-bob { animation: bob 2.4s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-1.4px); } }
.p-spark { transform-box: fill-box; transform-origin: center; animation: twinkle 2.2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1); } }
.p-glow { animation: glow 2.8s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: .55; } to { opacity: 1; } }
.p-spin { transform-box: view-box; animation: spin 26s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.p-pulse { transform-box: view-box; animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.04); filter: brightness(1.25); } }
.p-flick { transform-box: view-box; animation: flick .9s ease-in-out infinite alternate; }
@keyframes flick { from { transform: scale(1, 1) skewX(-3deg); } to { transform: scale(.94, 1.08) skewX(3deg); } }
.p-canopy { transform-box: view-box; animation: flutter 4s ease-in-out infinite alternate; }
.p-wet { animation: glow 3s ease-in-out infinite alternate; }
.p-img { position: absolute; left: 50%; bottom: 12%; width: 72%; height: 82%; object-fit: contain; object-position: center bottom; transform-origin: 50% 100%; translate: -50% 0; pointer-events: none; }
.p-sway-img { animation: swayimg 4.6s ease-in-out infinite alternate; }
@keyframes swayimg { from { rotate: -2deg; } to { rotate: 2deg; } }
.p-img.is-dry { filter: saturate(.45) sepia(.25); rotate: 3deg; }
.p-img.is-ripe { filter: drop-shadow(0 0 10px rgba(255, 197, 51, .75)); }

/* ===================== Game toàn màn hình ===================== */
.gm-body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #5fb6f0; font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif; color: #3d2a17;
    -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html:has(.gm-body) { height: 100%; overflow: hidden; }
.gm { --sky1: #5fb6f0; --sky2: #c9ecff; --ground1: #6bb987; --ground2: #4c9a63; --wood: #8a5a2b; --wood-d: #5a3a1c; --paper: #fff8e6; --paper2: #f6e7c4; --ink: #3d2a17; --gold: #ffc533; --green: #3fae5a;
    --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
    position: fixed; inset: 0; overflow: hidden; }
.gm button, .gm a { font-family: inherit; }
.gm [hidden] { display: none !important; }
.gm-world { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 42%, var(--ground1) 42.2%, var(--ground2) 100%); }
.gm-world.is-drag { cursor: grabbing; }
.gm-cam { position: absolute; left: 0; top: 0; width: 1000px; height: 660px; transform-origin: 0 0; will-change: transform; }
.gm-bg { position: absolute; inset: 0; width: 1000px; height: 660px; display: block; overflow: visible; }
.gm-plots, .gm-fx { position: absolute; inset: 0; }
.gm-fx { pointer-events: none; z-index: 90; }
.gm.is-peek .gd-bld:not([data-b="board"]) { filter: saturate(.7); }

/* HUD trên */
.gm-hud { position: absolute; top: calc(var(--safe-t) + 8px); left: calc(var(--safe-l) + 8px); right: calc(var(--safe-r) + 8px); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; z-index: 20; }
.gm-hud > * { pointer-events: auto; }
.gm-lv { position: relative; display: flex; align-items: center; min-width: 0; padding: 0 12px 0 0; margin: 4px 0 0; border: 0; background: none; cursor: pointer; }
.gm-lv-star { position: relative; z-index: 2; flex: 0 0 auto; width: 54px; height: 54px; display: grid; place-items: center; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
.gm-lv-star svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gm-lv-star b { position: relative; font: 800 19px/1 "Baloo 2", sans-serif; color: #fff; -webkit-text-stroke: 4px #8a5a00; paint-order: stroke fill; margin-top: 4px; }
.gm-lv-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; margin-left: -14px; padding: 5px 12px 6px 20px; border-radius: 0 16px 16px 0; background: rgba(40, 26, 12, .62); border: 2px solid rgba(255, 255, 255, .55); border-left: 0; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.gm-name { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 13px/1.15 "Baloo 2", sans-serif; color: #fff; text-align: left; }
.gm-xp { position: relative; display: block; width: clamp(96px, 30vw, 170px); height: 14px; border-radius: 8px; background: rgba(0, 0, 0, .45); overflow: hidden; border: 1.5px solid rgba(255, 255, 255, .35); }
.gm-xp i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(180deg, #a8f07a, #41b83a); border-radius: 8px; transition: width .6s; }
.gm-xp em { position: relative; display: block; font: 700 10px/12px "Baloo 2", sans-serif; color: #fff; font-style: normal; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.gm-res { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.gm-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 4px; border-radius: 18px; background: rgba(40, 26, 12, .62); border: 2px solid rgba(255, 255, 255, .55); color: #fff; text-decoration: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.gm-pill b { font: 800 17px/1 "Baloo 2", sans-serif; min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.gm-coin-ico { width: 30px; height: 30px; margin-left: -6px; border-radius: 50%; display: grid; place-items: center; font: 800 15px/1 "Baloo 2", sans-serif; color: #8a5a00; background: radial-gradient(circle at 35% 30%, #fff3a8, #ffc533 55%, #d18a00); border: 2px solid #8a5a00; box-shadow: 0 2px 3px rgba(0, 0, 0, .3); }
.gm-coin i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 18px/1 "Baloo 2", sans-serif; font-style: normal; color: #fff; background: linear-gradient(180deg, #6fd36a, #2f9a4a); border: 2px solid #1f6b31; }
.gm-coin.is-bump { animation: gmBump .5s; }
@keyframes gmBump { 30% { transform: scale(1.15); } }
.gm-today { height: 28px; padding: 0 10px 0 8px; font-size: 12px; }
.gm-today svg { width: 16px; height: 16px; color: #a8f07a; }
.gm-today b { font-size: 14px; min-width: 0; }
.gm-today.is-cap { border-color: #ffc533; }
.gm-today.is-cap b { color: #ffc533; }

/* Cột nút phải */
.gm-side { position: absolute; right: calc(var(--safe-r) + 8px); top: calc(var(--safe-t) + 96px); display: flex; flex-direction: column; gap: 10px; z-index: 19; }
.gm-sbtn { position: relative; width: 58px; padding: 0; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.gm-sbtn svg { width: 50px; height: 50px; padding: 5px; box-sizing: border-box; border-radius: 16px; background: linear-gradient(180deg, #fff6dc, #f1d9a4); border: 3px solid var(--wood); box-shadow: 0 4px 0 var(--wood-d), 0 6px 10px rgba(0, 0, 0, .3); transition: transform .1s; }
.gm-sbtn:active svg { transform: translateY(3px); box-shadow: 0 1px 0 var(--wood-d); }
.gm-sbtn span { font: 700 11px/1.1 "Baloo 2", sans-serif; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 4px rgba(0, 0, 0, .6); white-space: nowrap; }
.gm-sbtn-sm svg { width: 40px; height: 40px; padding: 7px; background: rgba(40, 26, 12, .55); border: 2px solid rgba(255, 255, 255, .55); box-shadow: none; border-radius: 50%; }
.gm-badge { position: absolute; top: -4px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e6141f; color: #fff; font: 800 12px/20px "Baloo 2", sans-serif; font-style: normal; text-align: center; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); box-sizing: border-box; }

.gm-tip { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 108px); translate: -50% 0; max-width: min(86vw, 420px); padding: 8px 14px; border-radius: 16px; background: rgba(40, 26, 12, .72); color: #fff; font: 700 13px/1.3 "Baloo 2", sans-serif; text-align: center; z-index: 18; pointer-events: none; animation: gmTipIn .3s; }
@keyframes gmTipIn { from { opacity: 0; transform: translateY(8px); } }

/* Thanh dưới */
.gm-dock { position: absolute; left: calc(var(--safe-l) + 8px); right: calc(var(--safe-r) + 8px); bottom: calc(var(--safe-b) + 8px); display: flex; align-items: flex-end; gap: 8px; z-index: 20; pointer-events: none; }
.gm-dock > * { pointer-events: auto; }
.gm-dock-l { display: flex; flex-direction: column; gap: 8px; }
.gm-rbtn { width: 48px; height: 48px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: rgba(40, 26, 12, .6); border: 2.5px solid rgba(255, 255, 255, .6); box-shadow: 0 3px 8px rgba(0, 0, 0, .3); }
.gm-rbtn svg { width: 34px; height: 34px; }
.gm-gear svg { animation: gmGear 12s linear infinite; }
@keyframes gmGear { to { transform: rotate(360deg); } }
.gm-dock-c { flex: 1 1 auto; display: flex; justify-content: center; gap: 10px; min-width: 0; }
.gm-dbtn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 74px; padding: 6px 4px 7px; border-radius: 18px; cursor: pointer; text-decoration: none;
    background: linear-gradient(180deg, #fff6dc, #f1d9a4); border: 3px solid var(--wood); box-shadow: 0 5px 0 var(--wood-d), 0 8px 14px rgba(0, 0, 0, .3); transition: transform .1s; }
.gm-dbtn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--wood-d); }
.gm-dico svg { width: 40px; height: 40px; display: block; }
.gm-dbtn > span:not(.gm-dico) { font: 800 12px/1.1 "Baloo 2", sans-serif; color: var(--ink); white-space: nowrap; }
.gm-dbtn .gm-badge { top: -8px; right: -6px; }
.gm-d-help { background: linear-gradient(180deg, #d8f0ff, #9fd3ff); border-color: #1d6fb0; box-shadow: 0 5px 0 #13507f, 0 8px 14px rgba(0, 0, 0, .3); width: 96px; }
.gm-d-help[disabled] { filter: grayscale(.8); opacity: .75; }
.gm-shop { position: relative; display: flex; flex-direction: column; align-items: center; width: 84px; height: 84px; padding: 4px 0 0; border-radius: 26px; cursor: pointer;
    background: radial-gradient(circle at 50% 35%, #fff3c4, #ffc533 70%); border: 3.5px solid #8a5a00; box-shadow: 0 6px 0 #6b4500, 0 10px 18px rgba(0, 0, 0, .35); animation: gmShopBob 3s ease-in-out infinite; }
.gm-shop:active { transform: translateY(4px); box-shadow: 0 2px 0 #6b4500; animation: none; }
.gm-shop svg { width: 56px; height: 56px; }
.gm-shop span { font: 800 13px/1 "Baloo 2", sans-serif; color: #5a3a00; margin-top: -4px; }
@keyframes gmShopBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* Bảng dưới (chi tiết ô đất / công trình) */
.gm-sheet { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 8px); width: min(560px, calc(100% - 16px - var(--safe-l) - var(--safe-r))); translate: -50% 0; max-height: min(62dvh, 560px); overflow: auto;
    box-sizing: border-box; padding: 14px 14px 12px; border-radius: 24px; z-index: 30; color: var(--ink);
    background: linear-gradient(180deg, var(--paper), var(--paper2)); border: 4px solid var(--wood); box-shadow: 0 6px 0 var(--wood-d), 0 18px 40px rgba(0, 0, 0, .45); animation: gmSheetIn .25s cubic-bezier(.2, 1.3, .5, 1); overscroll-behavior: contain; touch-action: pan-y; }
@keyframes gmSheetIn { from { transform: translateY(40px); opacity: 0; } }
.gm-sheet h3 { margin: 0 34px 6px 0; font: 800 20px/1.15 "Baloo 2", sans-serif; }
.gm-sheet h3 small { font-size: 13px; color: #8a6338; font-weight: 700; }
.gm-sheet .gm-x { top: 6px; right: 8px; }
.gm-x { position: absolute; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 3px solid #fff; background: #e6141f; color: #fff; font: 800 22px/28px "Baloo 2", sans-serif; cursor: pointer; box-shadow: 0 3px 0 #8a0d14, 0 4px 8px rgba(0, 0, 0, .3); z-index: 3; }
.gm-detail { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: start; }
.gm-pic { position: relative; display: block; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: radial-gradient(circle at 50% 70%, #cfe9b8, #8cc56d); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); }
.gm-pic svg { width: 100%; height: 100%; display: block; }
.gm-p { margin: 4px 0; font-size: 14px; line-height: 1.4; }
.gm-steps { display: flex; gap: 4px; margin: 2px 0 6px; }
.gm-steps i { flex: 1; height: 7px; border-radius: 4px; background: rgba(61, 42, 23, .18); }
.gm-steps i.on { background: var(--green); }
.gm-bar { position: relative; height: 16px; border-radius: 9px; background: rgba(61, 42, 23, .18); overflow: hidden; border: 2px solid rgba(61, 42, 23, .25); margin: 4px 0; }
.gm-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; transition: width .9s linear; }
.gm-bar em { position: relative; display: block; font: 700 11px/12px "Baloo 2", sans-serif; font-style: normal; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.gm-bar-grow i { background: linear-gradient(180deg, #a8f07a, #41b83a); }
.gm-bar-water i { background: linear-gradient(180deg, #a6dcff, #2f8ee0); }
.gm-warn { color: #c2410c; font-weight: 700; }
.gm-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 16px; border-radius: 14px; cursor: pointer; text-decoration: none;
    font: 800 15px/1.1 "Baloo 2", sans-serif; color: #fff; background: linear-gradient(180deg, #6fd36a, #2f9a4a); border: 2.5px solid #1f6b31; box-shadow: 0 4px 0 #1f6b31; text-shadow: 0 1px 1px rgba(0, 0, 0, .3); transition: transform .08s; }
.gm-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1f6b31; }
.gm-btn[disabled] { filter: grayscale(1); opacity: .55; cursor: not-allowed; transform: none; }
.gm-btn-blue { background: linear-gradient(180deg, #6cc0ff, #2a7fd4); border-color: #13507f; box-shadow: 0 4px 0 #13507f; }
.gm-btn-gold { background: linear-gradient(180deg, #ffe07a, #f5a300); border-color: #8a5a00; box-shadow: 0 4px 0 #8a5a00; color: #4a2f00; text-shadow: none; }
.gm-btn-red { background: linear-gradient(180deg, #ff7a6b, #d62c1f); border-color: #8a0d14; box-shadow: 0 4px 0 #8a0d14; }
.gm-btn-ghost { background: rgba(255, 255, 255, .6); color: var(--ink); border-color: #b38a5c; box-shadow: 0 4px 0 #b38a5c; text-shadow: none; }
.gm-btn-sm { min-height: 36px; padding: 4px 12px; font-size: 13.5px; border-radius: 12px; }
.gm-tipline { margin: 6px 0 0; font-size: 13px; color: #6b4a2b; line-height: 1.45; }

/* Danh sách hạt giống / kho */
.gm-seeds { display: grid; gap: 8px; margin-top: 6px; }
.gm-seed { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: 16px; background: rgba(255, 255, 255, .65); border: 2px solid #e2c99a; }
.gm-seed.is-lock { opacity: .55; }
.gm-seed .gm-pic { border-width: 2px; border-radius: 14px; }
.gm-seed-i { display: grid; gap: 1px; min-width: 0; font-size: 12.5px; color: #6b4a2b; }
.gm-seed-i b { font: 800 16px/1.15 "Baloo 2", sans-serif; color: var(--ink); }
.gm-seed-a { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.gm-tag { display: inline-block; padding: 0 7px; border-radius: 8px; background: #e6141f; color: #fff; font: 800 10.5px/17px "Baloo 2", sans-serif; vertical-align: 2px; }
.gm-own { color: #1f7a33; font-weight: 700; }
.gm-odds summary { cursor: pointer; color: #2a7fd4; font-weight: 700; font-size: 12px; }
.gm-odds ul, .gm-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.gm-odds li, .gm-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.gm-list li { padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, .55); }
.gm-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.gm-inv-i { display: grid; justify-items: center; gap: 3px; padding: 8px 6px; border-radius: 16px; background: rgba(255, 255, 255, .65); border: 2px solid #e2c99a; text-align: center; font-size: 12.5px; }
.gm-inv-i .gm-pic { width: 64px; border-width: 2px; }
.gm-inv-i b { font: 800 14px/1.1 "Baloo 2", sans-serif; }
.gm-need { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gm-need li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px; border-radius: 16px; background: rgba(255, 255, 255, .65); border: 2px solid #e2c99a; }
.gm-need li div { display: grid; min-width: 0; font-size: 12.5px; color: #6b4a2b; }
.gm-need li div b { color: var(--ink); font: 800 15px/1.2 "Baloo 2", sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-av { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--green); color: #fff; font: 800 18px/1 "Baloo 2", sans-serif; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); text-decoration: none; }
.gm-av img { width: 100%; height: 100%; object-fit: cover; }
.gm-logs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gm-logs li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; padding: 7px 10px; border-radius: 12px; background: rgba(255, 255, 255, .55); font-size: 13px; }
.gm-logs time { color: #8a6338; font-variant-numeric: tabular-nums; }
.gm-logs span { color: #6b4a2b; overflow-wrap: anywhere; }
.gm-stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; margin-bottom: 8px; }
.gm-stages figure { margin: 0; text-align: center; font-size: 11.5px; color: #6b4a2b; }
.gm-cap { margin: 0 0 8px; padding: 8px 10px; border-radius: 12px; background: #fff1c7; border: 2px dashed #e0a500; font-size: 13px; color: #6b4500; }

/* Hộp thoại giữa màn hình */
.gm-modal { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: calc(var(--safe-t) + 16px) 14px calc(var(--safe-b) + 16px); background: rgba(10, 20, 10, .55); animation: gmFade .2s; }
@keyframes gmFade { from { opacity: 0; } }
.gm-card { position: relative; width: min(520px, 100%); max-height: 100%; overflow: auto; box-sizing: border-box; padding: 18px 16px 16px; border-radius: 26px; color: var(--ink);
    background: linear-gradient(180deg, var(--paper), var(--paper2)); border: 4px solid var(--wood); box-shadow: 0 6px 0 var(--wood-d), 0 24px 50px rgba(0, 0, 0, .5); animation: gmPop .3s cubic-bezier(.2, 1.4, .5, 1); overscroll-behavior: contain; }
@keyframes gmPop { from { transform: scale(.85); opacity: 0; } }
.gm-card .gm-x { top: 8px; right: 8px; }
.gm-ribbon { display: block; width: fit-content; max-width: calc(100% - 96px); margin: 0 auto 12px; padding: 6px 26px 8px; border-radius: 12px; background: linear-gradient(180deg, #ff6b5e, #d62c1f); border: 3px solid #8a0d14;
    color: #fff; font: 800 20px/1.1 "Baloo 2", sans-serif; text-align: center; text-shadow: 0 2px 0 #8a0d14; box-shadow: 0 4px 0 #8a0d14; }
.gm-ribbon.green { background: linear-gradient(180deg, #6fd36a, #2f9a4a); border-color: #1f6b31; text-shadow: 0 2px 0 #1f6b31; box-shadow: 0 4px 0 #1f6b31; }
.gm-ribbon.gold { background: linear-gradient(180deg, #ffe07a, #f5a300); border-color: #8a5a00; color: #4a2f00; text-shadow: none; box-shadow: 0 4px 0 #8a5a00; }
.gm-harvest { display: grid; justify-items: center; gap: 8px; text-align: center; }
.gm-harvest .gm-pic { width: 130px; animation: gmPop .5s cubic-bezier(.3, 1.6, .5, 1); }
.gm-harvest ul { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 6px; }
.gm-harvest li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 197, 51, .22); font-size: 14px; }
.gm-harvest li b { color: #9a5b00; text-align: right; }
.gm-lvup { display: grid; justify-items: center; gap: 6px; text-align: center; }
.gm-lvup .gm-lv-star { width: 110px; height: 110px; animation: gmSpinIn .8s cubic-bezier(.2, 1.4, .4, 1); }
.gm-lvup .gm-lv-star b { font-size: 40px; -webkit-text-stroke-width: 6px; }
@keyframes gmSpinIn { from { transform: scale(0) rotate(-180deg); } }

/* Cài đặt */
.gm-set { display: grid; gap: 10px; }
.gm-set-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 16px; background: rgba(255, 255, 255, .6); border: 2px solid #e2c99a; }
.gm-set-row > svg { width: 40px; height: 40px; }
.gm-set-row b { display: block; font: 800 15px/1.2 "Baloo 2", sans-serif; }
.gm-set-row small { color: #6b4a2b; font-size: 12px; }
.gm-set-row input[type=range] { width: 100%; accent-color: var(--green); margin-top: 4px; }
.gm-switch { position: relative; width: 58px; height: 32px; padding: 0; border-radius: 18px; border: 2.5px solid #8a6338; background: #cbb38c; cursor: pointer; transition: background .2s; }
.gm-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: 0 2px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.gm-switch[aria-checked="true"] { background: var(--green); border-color: #1f6b31; }
.gm-switch[aria-checked="true"]::after { transform: translateX(26px); }
.gm-seg { display: inline-flex; border-radius: 12px; overflow: hidden; border: 2.5px solid #8a6338; }
.gm-seg button { padding: 6px 10px; border: 0; background: #f1d9a4; font: 800 12.5px/1 "Baloo 2", sans-serif; color: var(--ink); cursor: pointer; }
.gm-seg button.on { background: var(--green); color: #fff; }
.gm-set-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }

/* Thông báo + chữ bay */
.gm-toast { position: absolute; left: 50%; top: calc(var(--safe-t) + 74px); translate: -50% 0; z-index: 50; max-width: min(90vw, 440px); padding: 9px 16px; border-radius: 16px; background: rgba(31, 107, 49, .95); border: 2px solid #fff; color: #fff;
    font: 700 14px/1.3 "Baloo 2", sans-serif; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); animation: gmToast .25s cubic-bezier(.2, 1.4, .5, 1); pointer-events: none; }
.gm-toast.is-bad { background: rgba(170, 40, 25, .95); }
@keyframes gmToast { from { transform: translateY(-14px); opacity: 0; } }
.gm-float { position: absolute; z-index: 95; translate: -50% 0; white-space: nowrap; font: 800 24px/1 "Baloo 2", sans-serif; color: #ffd84d; -webkit-text-stroke: 5px #6b4500; paint-order: stroke fill; animation: gmFloat 1.6s ease-out forwards; pointer-events: none; }
.gm-float.xp { color: #a8f07a; -webkit-text-stroke-color: #1f6b31; }
.gm-float.pts { color: #9fd3ff; -webkit-text-stroke-color: #13507f; }
@keyframes gmFloat { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-70px) scale(1); } }
.gm-confetti { position: absolute; top: -10px; width: 9px; height: 14px; z-index: 60; pointer-events: none; animation: gmConf 2.2s ease-in forwards; }
@keyframes gmConf { to { transform: translateY(105dvh) rotate(720deg); opacity: .8; } }

/* Màn hình chờ */
.gm-splash { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; text-align: center; color: #fff;
    background: radial-gradient(120% 90% at 50% 0%, #9be38a 0%, #4c9a3a 55%, #2f6b26 100%); transition: opacity .45s, visibility .45s; }
.gm-splash.is-out { opacity: 0; visibility: hidden; }
.gm-splash-in { display: grid; justify-items: center; gap: 10px; max-width: 360px; }
.gm-logo svg { width: 132px; height: 132px; animation: gmLogo 2.4s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .3)); }
@keyframes gmLogo { 50% { transform: translateY(-8px) rotate(-3deg); } }
.gm-splash h1 { margin: 0; font: 800 52px/1 "Baloo 2", sans-serif; letter-spacing: .5px; -webkit-text-stroke: 7px #1f4f1a; paint-order: stroke fill; }
.gm-splash h1 span { color: #ffd84d; }
.gm-splash p { margin: 0; font-weight: 600; opacity: .95; }
.gm-splash small { opacity: .85; font-size: 12.5px; }
.gm-load { width: 240px; height: 16px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 2.5px solid #fff; overflow: hidden; }
.gm-load i { display: block; width: 10%; height: 100%; background: linear-gradient(180deg, #ffe07a, #f5a300); transition: width .4s; }
.gm-play { display: inline-flex; justify-content: center; align-items: center; min-width: 220px; min-height: 56px; padding: 8px 22px; margin-top: 6px; border-radius: 20px; cursor: pointer; text-decoration: none;
    font: 800 22px/1 "Baloo 2", sans-serif; color: #4a2f00; background: linear-gradient(180deg, #ffe07a, #f5a300); border: 3.5px solid #8a5a00; box-shadow: 0 6px 0 #6b4500, 0 10px 20px rgba(0, 0, 0, .3); }
.gm-play:not([disabled]) { animation: gmShopBob 1.6s ease-in-out infinite; }
.gm-play[disabled] { font-size: 16px; opacity: .85; cursor: progress; }
.gm-sec { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.gm-guest { max-width: 300px; }
.gm-noscript { position: absolute; inset: auto 0 0; padding: 12px; background: #b91c1c; color: #fff; text-align: center; z-index: 99; }

/* Tiết kiệm pin: tắt chuyển động trang trí */
.gm.lite .gd-cloud, .gm.lite .gd-bfly, .gm.lite .gd-ffly, .gm.lite .gd-tree, .gm.lite .gd-star, .gm.lite .p-leaf, .gm.lite .p-sway, .gm.lite .p-canopy, .gm.lite .p-spin, .gm.lite .gm-gear svg, .gm.lite .gm-shop { animation: none !important; }
.gm.lite .gd-bfly, .gm.lite .gd-ffly, .gm.lite .gd-cloud { display: none; }
@media (prefers-reduced-motion: reduce) { .gm *, .gm svg * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* Màn hình lớn: bảng dưới sang góc trái, nút to hơn */
@media (min-width: 900px) {
    .gm-sheet { left: calc(var(--safe-l) + 76px); translate: none; bottom: calc(var(--safe-b) + 112px); width: 420px; max-height: calc(100dvh - 220px); }
    .gm-dock-c { gap: 14px; }
    .gm-dbtn { width: 86px; }
    .gm-name { max-width: 260px; }
}
/* Điện thoại xoay ngang / màn thấp */
@media (max-height: 520px) {
    .gm-side { top: calc(var(--safe-t) + 70px); gap: 6px; flex-direction: row; right: calc(var(--safe-r) + 100px); top: auto; bottom: calc(var(--safe-b) + 10px); }
    .gm-sbtn span { display: none; }
    .gm-sbtn svg { width: 42px; height: 42px; }
    .gm-dock-c { justify-content: flex-start; }
    .gm-dbtn { width: 64px; padding: 4px 3px 5px; }
    .gm-dico svg { width: 32px; height: 32px; }
    .gm-shop { width: 70px; height: 70px; }
    .gm-shop svg { width: 46px; height: 46px; }
    .gm-sheet { max-height: calc(100dvh - 24px); bottom: calc(var(--safe-b) + 8px); z-index: 30; }
    .gm-tip { bottom: calc(var(--safe-b) + 86px); }
    .gm-splash h1 { font-size: 38px; } .gm-logo svg { width: 84px; height: 84px; }
}
@media (max-width: 360px) {
    .gm-dbtn { width: 64px; } .gm-dock-c { gap: 6px; } .gm-shop { width: 74px; height: 74px; } .gm-shop svg { width: 48px; height: 48px; }
    .gm-xp { width: 88px; }
}
