/* UI-BASE-01 V1.1 cropped sprite assets; overlays only, not independent game state */
.freeplay-hud{position:absolute;inset:0;z-index:20;pointer-events:none;font-family:system-ui,"PingFang SC",sans-serif;color:#543922;font-weight:800}
.freeplay-hud button{pointer-events:auto}.fp-date{position:absolute;top:16px;left:18px;width:177px;height:70px;padding:13px 22px 9px 30px;background:url('../ui/sprites/UI_01_date_time__date_panel.png') center/100% 100% no-repeat;image-rendering:auto;display:flex;flex-direction:column;justify-content:center;font-size:16px;text-shadow:0 1px #fff8e8}
.fp-date small{font-size:12px;color:#7c6046;margin-top:2px}.fp-gold{position:absolute;top:18px;right:90px;min-width:149px;height:45px;display:flex;align-items:center;gap:9px;padding:0 20px 0 22px;background:url('../ui/sprites/UI_02_currency_settings__currency_bar_gold.png') center/100% 100% no-repeat;color:#764315;text-shadow:0 1px #fff5dd;font-size:16px}.fp-gold span{color:#c8872c}
.fp-quest{position:absolute;top:89px;left:20px;width:188px;min-height:68px;padding:12px 15px;background:#fff1d9ed;border:3px solid #986c47;box-shadow:3px 4px #7e542f;border-radius:12px;font-size:15px}.fp-quest small{display:block;font-size:11px;color:#86644e;margin-top:4px}.fp-sidebar{position:absolute;top:91px;right:19px;display:flex;flex-direction:column;gap:9px}.fp-sidebar button{width:58px;height:58px;border:0;background:url('../ui/sprites/UI_04_sidebar__sidebar_slot_normal.png') center/contain no-repeat;padding:11px;filter:drop-shadow(0 3px 2px #38291e55);transition:transform .12s}.fp-sidebar button:hover{transform:translateX(-4px)}.fp-sidebar img{width:100%;height:100%;object-fit:contain}.fp-hotbar{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);display:flex;justify-content:center;gap:6px;max-width:70vw;padding:13px 17px;background:#e8c69dec;border:4px solid #a57644;border-radius:16px;box-shadow:0 4px 0 #765030,0 6px 17px #31201588;pointer-events:auto}.fp-slot{position:relative;width:47px;height:48px;border:2px solid #b27c4b;border-radius:10px;background:url('../ui/sprites/UI_05_hotbar_items__item_slot_normal.png') center/100% 100% no-repeat;display:grid;place-items:center;padding:7px}.fp-slot.selected{background-image:url('../ui/sprites/UI_05_hotbar_items__item_slot_selected.png');transform:translateY(-3px)}.fp-slot img{max-width:31px;max-height:29px;object-fit:contain;image-rendering:pixelated}.fp-slot small{position:absolute;bottom:0;right:2px;color:#fff7dd;background:#71452dcc;padding:0 2px;border-radius:3px;font-size:10px}
.fp-overlay{position:absolute;inset:0;z-index:70;background:#2419108a;display:grid;place-items:center;padding:25px;backdrop-filter:blur(2px);pointer-events:auto}.fp-sheet{width:min(760px,92vw);max-height:min(82vh,770px);overflow:hidden;display:flex;flex-direction:column;border:7px solid #a77146;border-radius:20px;background:#f9efdc url('../ui/sprites/UI_09_common__popup_large.png') center/100% 100% no-repeat;box-shadow:0 13px 0 #583b29,0 23px 52px #291b1466;color:#593e29}.fp-sheet header{display:flex;align-items:center;justify-content:space-between;min-height:65px;padding:7px 18px 9px 26px;border-bottom:2px solid #e8cba5;font-size:22px;font-weight:900;letter-spacing:1px}.fp-sheet header button{width:39px;height:38px;border:0;background:url('../ui/sprites/UI_09_common__window_close.png') center/contain no-repeat;font-size:0}.fp-sheet header button:focus-visible{outline:3px solid #c87958}.fp-sheet #fpPanelBody{padding:20px 28px 30px;overflow:auto;font-size:14px;line-height:1.65}.fp-summary{border:1px solid #dfb88d;border-radius:10px;background:#fffcf4d9;margin:0 0 16px;padding:11px 14px;font-weight:700}.fp-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.fp-item{display:grid;grid-template-columns:1fr auto;gap:1px 10px;align-items:center;border:2px solid #dbb791;border-radius:9px;background:#fffaf3;padding:9px 11px}.fp-item span{font-weight:750}.fp-item small{font-size:10px;color:#a07856}.fp-item b{grid-column:2;grid-row:1/3;color:#a45d2d}.fp-hint{color:#9a7455;font-size:12px}.fp-map-image{width:100%;height:auto;max-height:380px;object-fit:contain;image-rendering:auto;border:4px solid #c3a180;border-radius:12px}.fp-map-links{text-align:center;padding:10px;color:#705338}.fp-relations{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.fp-relations article{border:2px solid #e2c19b;border-radius:11px;padding:12px 9px;background:#fff8ee}.fp-relations b,.fp-relations small,.fp-relations span{display:block}.fp-relations small{color:#a78568;font-size:10px}.fp-relations span{margin-top:7px;font-size:11px;color:#9a6d4e}.fp-guide{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.fp-guide p{margin:0;padding:10px 12px;background:#fff9ed;border:1px solid #e3c6a1;border-radius:9px}.fp-menu-actions,.fp-trial-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.fp-trial-actions{grid-template-columns:1fr}.fp-btn{min-height:53px;font-weight:800;font-size:14px;line-height:1.3;border:2px solid #8d603e;color:#66402c;background:#f4d6a1 url('../ui/sprites/UI_09_common__button_cream_normal.png') center/100% 100% no-repeat;border-radius:10px;box-shadow:0 3px #ad7a4c;padding:9px 16px}.fp-btn:hover{filter:brightness(1.05);transform:translateY(-2px)}.fp-btn:active{transform:translateY(1px)}.fp-warning{color:#aa4c2d;font-weight:700;background:#fff0df;padding:9px}.freeplay-menu-options{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0}.freeplay-menu-options button{min-height:44px;background:#fff3db;color:#704d32;border:2px solid #9e744e;border-radius:11px;font-weight:700;font-size:12px}.freeplay-menu-options button:last-child{grid-column:span 2}.freeplay-menu-options button:disabled{opacity:.6}
/* keep the old zoom/menu accessible but below the official HUD */
.viewport-top{z-index:12;top:75px!important;pointer-events:none}.viewport-top .viewport-badges button{pointer-events:auto}.viewport-top .scene-chip{opacity:.0;pointer-events:none}.freeplay-hud:not([hidden])~.viewport-top .viewport-badges{position:relative;top:0;right:0;opacity:.92}
@media(max-width:700px){.fp-date{top:7px;left:6px;width:139px;height:58px;font-size:13px}.fp-gold{top:8px;right:6px;min-width:105px;height:39px;font-size:13px}.fp-quest{top:74px;left:7px;width:135px;font-size:12px}.fp-sidebar{top:86px;right:6px;gap:4px}.fp-sidebar button{width:43px;height:43px}.fp-hotbar{bottom:5px;padding:8px;gap:3px;max-width:99vw}.fp-slot{width:36px;height:38px;padding:4px}.fp-slot img{max-width:24px}.fp-sheet #fpPanelBody{padding:13px}.fp-items,.fp-guide{grid-template-columns:1fr}.fp-relations{grid-template-columns:repeat(2,minmax(0,1fr))}.fp-sheet header{font-size:18px}.fp-overlay{padding:8px}}

/* Official FREEPLAY presentation: hide legacy white test/debug buttons while retaining keyboard zoom and all authentic world hotspots. */
body.fp-mode .viewport-top .viewport-badges{display:none!important}
/* Don't let HUD shortcut buttons overlap native source-module panels. */
.viewport:has(#farmPanel:not([hidden])) .fp-sidebar,
.viewport:has(#animalPanel:not([hidden])) .fp-sidebar,
.viewport:has(#processingPanel:not([hidden])) .fp-sidebar,
.viewport:has(#storagePanel:not([hidden])) .fp-sidebar,
.viewport:has(.core06-panel:not([hidden])) .fp-sidebar{visibility:hidden;pointer-events:none}

.fp-sidebar #fpDeveloperButton{color:#683b25;font-size:23px;font-weight:900;background-color:#f6d5a8}
/* FREEPLAY V1.2: unified responsive touch controls, item reference hotbar and information */
.fp-information{position:absolute;left:20px;top:166px;width:236px;min-height:74px;max-height:190px;overflow:hidden;border:3px solid #a97c50;border-radius:14px;background:#fff6dded;box-shadow:0 4px 0 #825631,0 8px 16px #3a271f55;color:#6b462c;padding:8px 12px;pointer-events:auto;font-size:12px;font-weight:600}
.fp-information strong{font-size:14px;color:#895432}.fp-information button{float:right;border:1px solid #d5ae83;background:#fff0d4;border-radius:6px;min-width:27px;color:#704a30}.fp-information p{margin:5px 0 0;line-height:1.5;font-size:12px;max-height:135px;overflow-y:auto;white-space:normal;overflow-wrap:anywhere}.fp-information.folded{min-height:38px;height:38px}.fp-information.folded p{display:none}
.fp-joy{position:absolute;left:33px;bottom:26px;width:146px;height:146px;border-radius:50%;display:grid;place-items:center;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;background:radial-gradient(circle,#f8e4bcaa 0 55%,#b7804caa 59% 64%,#fff1d033 66%);box-shadow:0 5px 15px #32201a55,0 0 0 2px #fff1ce99 inset}
.fp-joy-track{width:116px;height:116px;position:relative;border-radius:50%;border:3px solid #9f7549;background:radial-gradient(circle,#fceace55,#93663e66);display:grid;place-items:center}
.fp-joy-knob{width:63px;height:63px;border-radius:50%;border:4px solid #a77746;background:radial-gradient(circle at 40% 35%,#ffefc9,#ddaa70);box-shadow:0 3px 7px #51381e9c,0 0 0 2px #fff4d9 inset;will-change:transform}
.fp-right-controls{position:absolute;right:25px;bottom:30px;display:flex;align-items:flex-end;gap:14px;pointer-events:auto;touch-action:none}
.fp-right-controls button{color:#6b3a23;border:3px solid #8e5838;background:#f9dfb1 url('../ui/sprites/UI_09_common__button_cream_normal.png') center/100% 100%;box-shadow:0 5px 0 #785034,0 8px 15px #32201a66;font-weight:900;touch-action:none;user-select:none}
#fpInteract{width:94px;height:88px;border-radius:30px;font-size:17px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}#fpInteract small{font-size:11px;opacity:.7}#fpRun{width:63px;height:63px;border-radius:50%;font-size:15px;margin-bottom:4px}
.fp-hotbar{bottom:13px;min-height:58px;padding:6px 10px;gap:5px;background:#e6c59fe8;max-width:calc(100% - 400px);border:3px solid #a87946;z-index:1}
.fp-farm-toolbar{position:absolute;bottom:78px;left:50%;transform:translateX(-50%);display:flex;gap:5px;min-height:70px;padding:7px;background:#1e2821e8;border:3px solid #8e6b43;border-radius:10px;box-shadow:0 4px 0 #4b3824,0 6px 17px #20150c99;max-width:none;z-index:2;pointer-events:auto}
.fp-farm-toolbar[hidden]{display:none}
.fp-farm-toolbar .fp-farm-tool{width:66px!important;height:70px!important;min-width:66px!important;min-height:70px!important;border:1px solid #d4bf9670!important;background:#38433ae8!important;border-radius:6px!important;color:#fff4d0!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:0!important;padding:3px!important;line-height:1.1!important;transition:transform .12s,background .12s,border-color .12s;touch-action:manipulation}
.fp-farm-toolbar .fp-farm-tool img{width:29px!important;height:32px!important;max-width:29px!important;max-height:32px!important;object-fit:contain!important;image-rendering:pixelated}
.fp-farm-tool b{font-size:10px;font-weight:800}.fp-farm-tool small{font-size:9px;color:#e5c77c;margin-top:2px}.fp-farm-tool:hover{background:#4b5143e8!important;border-color:#e8c979!important}.fp-farm-tool.selected{border-color:#f0c76d!important;box-shadow:0 0 0 2px #e2b15e66!important;background:#6a5639e8!important;transform:translateY(-2px)}
.fp-slot{width:46px;height:48px;flex-shrink:0}.fp-slot em{position:absolute;top:-3px;left:2px;font-size:10px;font-style:normal;color:#806041}.fp-slot small{min-width:11px;text-align:right}.fp-fallback-item{font-size:24px;color:#af7748}.fp-empty-slot{font-size:21px;font-weight:500;color:#b9906b}
.fp-bag-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:12px 0 16px}.fp-bag-cell{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;min-height:98px;border:2px solid #d3ac76;border-radius:12px;background:#fffaf0;color:#704930;font-weight:700;cursor:pointer;padding:6px 4px}.fp-bag-cell.active,.fp-bag-slotline button.active{outline:3px solid #cb854e;background:#ffe4ab}.fp-bag-cell img{width:38px;height:38px;object-fit:contain;image-rendering:pixelated}.fp-bag-cell strong{font-size:11px;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.fp-bag-cell span{font-size:11px;color:#98704d}.fp-bag-slotline{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}.fp-bag-slotline button{height:82px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:2px solid #b98d59;border-radius:8px;background:#fff6df;color:#7b502e;cursor:pointer;padding:4px;overflow:hidden}.fp-bag-slotline img{width:29px;height:29px;object-fit:contain;image-rendering:pixelated}.fp-bag-slotline span{font-size:10px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fp-bag-slotline b{font-size:10px}.fp-bag-actions{margin-top:15px;display:flex;gap:10px}
/* distinct working indoor scenes, no cloned action controls */
body.fp-mode #btnCompanion{display:none!important}
@media(max-width:1030px){.fp-joy{width:115px;height:115px;left:11px;bottom:15px}.fp-joy-track{width:98px;height:98px}.fp-joy-knob{width:52px;height:52px}.fp-right-controls{right:10px;bottom:16px;gap:7px}#fpInteract{width:77px;height:72px;font-size:13px}#fpRun{width:51px;height:51px}.fp-hotbar{gap:1px;padding:4px 5px;max-width:calc(100% - 270px)}.fp-slot{width:34px;height:40px;padding:4px}.fp-slot img{max-width:26px;max-height:26px}.fp-information{top:148px;left:7px;width:194px;max-height:120px;font-size:11px}.fp-information p{font-size:10px}.fp-bag-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-height:540px){.fp-information{top:62px;left:152px;max-height:74px;width:160px}.fp-quest{top:76px}.fp-sidebar{top:54px}.fp-joy{width:99px;height:99px}.fp-joy-track{width:80px;height:80px}.fp-joy-knob{width:42px;height:42px}.fp-hotbar{bottom:6px}}

/* FIX-09: only the run control disables selection and iOS callouts. Text inputs elsewhere remain native. */
#fpRun,#fpRun *,#fpRun img{-webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important;-webkit-user-drag:none;touch-action:none!important;}
#fpRun{position:relative;overflow:hidden;border:0;background:transparent!important;padding:0;box-shadow:none!important;display:grid;place-items:center;isolation:isolate;}
#fpRun img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none;image-rendering:pixelated;}
#fpRun::after{content:'跑';position:relative;z-index:1;color:#674028;text-shadow:0 1px #ffefd6;font-weight:900;pointer-events:none;}
#fpRun:active{filter:brightness(.91);transform:translateY(2px)}


/* FREEPLAY HUD-002/004: approved custom artwork; preserve existing button hit boxes. */
.fp-sidebar button:has(img[src*="custom-v12"]){display:grid;place-items:center;padding:2px;background:transparent!important;border:0!important;box-shadow:none!important}
.fp-sidebar button img[src*="custom-v12"]{width:100%;height:100%;object-fit:contain;image-rendering:pixelated;pointer-events:none}
#fpRun{background:transparent!important;box-shadow:none!important;border:0!important;overflow:visible!important}
#fpRun img[src*="custom-v12"]{object-fit:contain}
#fpRun::after{content:none!important}
#fpInteract{position:relative;background:transparent!important;box-shadow:none!important;border:0!important;padding:0!important;overflow:visible}
#fpInteract img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;image-rendering:pixelated;pointer-events:none}
#fpInteract small{position:absolute;bottom:5px;left:50%;transform:translateX(-50%);z-index:1;font-size:11px;font-weight:900;background:#fff2d8d9;border-radius:6px;line-height:13px;pointer-events:none}
/* The farm actions now live in the same eight configurable V2.2 hotbar slots. */
#fpFarmToolbar{display:none!important}

/* FREEPLAY 2026-11-17 BUG-003: remove the obsolete Information panel,
   without removing real warning/transaction feedback. */
body.fp-mode #fpInformation{display:none!important}
body.fp-mode #toast{bottom:auto!important;top:105px!important;left:50%;z-index:75;max-width:50vw}

/* BUG-007: interactive touch surfaces scale with the left joystick;
   run retains its original smaller proportion. */
.fp-right-controls{right:24px;bottom:26px;gap:13px}
#fpInteract{width:146px!important;height:146px!important;min-width:146px;min-height:146px}
#fpRun{width:98px!important;height:98px!important;min-width:98px;min-height:98px;margin-bottom:5px!important}
#fpInteract small{bottom:12px!important}
@media(max-width:1030px){
 .fp-right-controls{right:10px;bottom:15px;gap:7px}
 #fpInteract{width:115px!important;height:115px!important;min-width:115px;min-height:115px}
 #fpRun{width:77px!important;height:77px!important;min-width:77px;min-height:77px}
}
@media(max-height:540px){
 .fp-right-controls{right:8px;bottom:6px;gap:5px}
 #fpInteract{width:99px!important;height:99px!important;min-width:99px;min-height:99px}
 #fpRun{width:66px!important;height:66px!important;min-width:66px;min-height:66px}
}

/* V1.5.2: WebKit flex children require min-height:0 to scroll within the quest sheet. */
.fp-sheet{min-height:0;max-width:calc(100vw - 16px)}
.fp-sheet #fpPanelBody{min-height:0;min-width:0;flex:1 1 auto;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;box-sizing:border-box}
.fp-story-journal,.fp-story-task,.fp-story-task>div{min-width:0;max-width:100%;box-sizing:border-box;overflow-wrap:anywhere}
@media(max-height:500px){.fp-sheet{max-height:calc(100dvh - 16px)}.fp-sheet header{min-height:44px}}

/* V1.5.5 / 2026-11-19 — Quest journal: clean card hierarchy without sprite bleed-through. */
.fp-overlay.quest-mode{padding:clamp(8px,2.6vh,22px);align-items:center}
.fp-overlay.quest-mode .fp-sheet{width:min(810px,96vw);height:min(750px,calc(100dvh - 26px));max-height:calc(100dvh - 26px);border:4px solid #ae865b;background:#fcf2df;box-shadow:0 8px 0 #65432d,0 18px 44px #21140e83;position:relative;isolation:isolate}
.fp-overlay.quest-mode .fp-sheet::before{content:'';position:absolute;inset:5px;border:2px solid #d8b891;pointer-events:none;border-radius:13px;z-index:-1}
.fp-overlay.quest-mode .fp-sheet header{flex-shrink:0;min-height:56px;padding:10px 22px;background:#ead1a7;border-bottom:2px solid #bc9165;font-size:20px}
.fp-overlay.quest-mode #fpPanelBody{flex:1 1 auto;min-height:0;padding:18px 23px 30px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable;line-height:1.5}
.fp-overlay.quest-mode .fp-summary{margin:0 0 14px;font-size:12px;font-weight:700;line-height:1.6;background:#fffaf2;border:1px solid #e1c9a8}
.fp-overlay.quest-mode .fp-story-journal{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
.fp-overlay.quest-mode .fp-story-task{display:grid;grid-template-columns:20px minmax(0,1fr);gap:9px;align-items:start;min-width:0;margin:0;padding:12px;background:#fffaf0;border:1px solid #ddbf98;border-radius:9px;box-shadow:none;overflow:visible}
.fp-overlay.quest-mode .fp-story-task.is-active{border-color:#b47e47;background:#fff7e7;box-shadow:inset 3px 0 0 #bb8b4e}
.fp-overlay.quest-mode .fp-story-task .fp-task-mark{width:20px;line-height:1.5;color:#9c7249;font-size:15px}
.fp-overlay.quest-mode .fp-story-task>div{min-width:0;overflow:hidden}
.fp-overlay.quest-mode .fp-story-task b{display:block;white-space:normal;overflow-wrap:anywhere;font-size:13px;line-height:1.5}
.fp-overlay.quest-mode .fp-story-task p{width:100%;max-width:100%;font-size:11px;line-height:1.55;overflow-wrap:anywhere;white-space:normal;margin:5px 0 0;padding:0;border:none;background:transparent}
.fp-overlay.quest-mode .fp-hint{font-size:11px;line-height:1.6;overflow-wrap:anywhere}
.fp-ball-checklist{margin:18px 0 6px;padding:16px;background:#fff9ee;border:1px solid #d4b288;border-radius:12px}
.fp-ball-checklist h3{display:flex;align-items:baseline;justify-content:space-between;gap:9px;margin:0 0 12px;color:#795032;font-size:16px}
.fp-ball-checklist h3 small{font-size:11px;color:#987b60;font-weight:500}
.fp-ball-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.fp-ball-item{min-width:0;display:grid;grid-template-columns:22px 46px minmax(0,1fr) auto;align-items:center;gap:8px;padding:10px;border:1px solid #e6cba9;border-radius:8px;background:#fffdf7}
.fp-ball-item.owned{background:#f0f5e7;border-color:#bbd1a2}
.fp-ball-dot{font-size:16px;color:#9d704c}.fp-ball-item.owned .fp-ball-dot{color:#608054}
.fp-ball-item strong{display:block;font-size:12px;overflow-wrap:anywhere}.fp-ball-item small{display:block;color:#926f54;font-size:10px;margin-top:2px}.fp-ball-item b{font-size:11px;white-space:nowrap}
@media(max-width:680px){.fp-overlay.quest-mode .fp-story-journal,.fp-ball-grid{grid-template-columns:1fr}.fp-overlay.quest-mode #fpPanelBody{padding:12px}.fp-ball-checklist{padding:12px}}
@media(max-height:500px){.fp-overlay.quest-mode .fp-sheet{height:calc(100dvh - 12px);max-height:calc(100dvh - 12px)}.fp-overlay.quest-mode .fp-sheet header{min-height:42px;padding:5px 14px}.fp-overlay.quest-mode #fpPanelBody{padding:10px 16px 18px}}

/* V1.5.9: original five ballroom supply icons */
.fp-ball-icon{width:46px;height:46px;object-fit:contain;image-rendering:pixelated;flex:none}
