@charset "UTF-8";
:root{font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif;color:#2d4431;font-synthesis:none;--u:min(.0598086vw,.1062699dvh,1px);--edge:clamp(12px,calc(22 * var(--u)),22px);--ink:#2d4431;--muted:#68705b;--line:#d6cfb6;--cream:#f5f1df;--green:#4e754b;--gold:#ffc338;--paper:url("../assets/ui/panel.png");--packet:url("../assets/ui/seed-packet.png")}
*{box-sizing:border-box}
html,body,#app{width:100%;height:100%;margin:0;overflow:hidden}
body{background:#91cdf5}
button,input,select{font:inherit}
button{cursor:pointer;color:var(--ink);border:1px solid var(--line);border-radius:11px;background:linear-gradient(#faf7e9,#eee9d8);padding:10px 16px;transition:filter .15s,transform .15s;font-weight:600}
button:hover:not(:disabled){filter:brightness(1.035)}button:active:not(:disabled){transform:translateY(1px)}button:disabled{cursor:not-allowed;opacity:.45}
button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid var(--gold);outline-offset:3px}canvas:focus{outline:none}
button.primary,.primary{background:linear-gradient(#5f8356,#426a42);color:#fffdf0;border-color:#41633d;font-weight:700}
h1,h2,h3,p{margin:0}h2{font-size:clamp(22px,calc(28 * var(--u)),28px)}h3{font-size:clamp(17px,calc(22 * var(--u)),22px)}
img,svg{display:block;flex-shrink:0}img{object-fit:contain;user-select:none;-webkit-user-drag:none}.crop-icon{width:32px;height:32px;object-fit:contain}.reference-icon{mix-blend-mode:darken}
[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* Full-screen world and interaction feedback. */
#scene-wrap{position:fixed;inset:0;background:linear-gradient(#84c6f6,#c3e6f5 52%,#a8bd74)}#scene{display:block;width:100%;height:100%;touch-action:none}
#renderer-error{position:absolute;inset:25%;z-index:50;display:grid;place-content:center;padding:30px;text-align:center;background:var(--cream);border:1px solid var(--line);border-radius:18px;font-size:17px;line-height:1.7}
#station-prompt{position:absolute;left:53%;top:58%;transform:translate(-50%,-50%);padding:12px 20px;max-width:90vw;border:1px solid var(--line);border-radius:12px;background:#faf7e7f2;box-shadow:0 3px 12px #2b472016;font-size:clamp(15px,calc(22 * var(--u)),22px);font-weight:700;text-align:center;pointer-events:none}#station-prompt:empty{display:none}
/* HUD, anchored to viewport edges independently of the windows. */
.station-marker{position:absolute;display:flex;align-items:center;gap:8px;transform:translate(-50%,-100%);padding:7px 13px;border:1px solid #b6ac89;border-radius:9px;background:#fff9e7ed;box-shadow:0 3px 8px #20372130;font-size:clamp(12px,1.15vw,17px);font-weight:700;white-space:nowrap;pointer-events:none}.station-marker img{width:26px;height:26px}.station-marker:after{content:"";position:absolute;left:calc(50% - 5px);bottom:-6px;width:10px;height:10px;background:#fff9e7;border-right:1px solid #b6ac89;border-bottom:1px solid #b6ac89;transform:rotate(45deg)}.station-marker.in-range{border-color:#e1ac37;box-shadow:0 0 14px #ffd66670}
.game-hud{position:fixed;top:max(calc(20 * var(--u)),env(safe-area-inset-top));left:var(--edge);right:var(--edge);z-index:30;display:flex;justify-content:space-between;align-items:flex-start;gap:14px;pointer-events:none}.game-hud button{pointer-events:auto}
.hud-resources,.hud-system{display:flex;align-items:center;gap:calc(16 * var(--u))}
.hud-pill{display:flex;align-items:center;gap:calc(12 * var(--u));min-height:calc(48 * var(--u));padding:calc(7 * var(--u)) calc(16 * var(--u));border:1px solid #c9cbb6;border-radius:calc(15 * var(--u));background:linear-gradient(#faf8ecf5,#eeeddeef);box-shadow:0 1px 1px #53624310;white-space:nowrap;font-size:clamp(15px,calc(22 * var(--u)),22px);font-weight:700}
.coin-pill{width:calc(158 * var(--u));padding-left:calc(11 * var(--u))}.coin-pill strong{font-size:clamp(21px,calc(26 * var(--u)),26px);font-variant-numeric:tabular-nums}.potion-pill{min-width:calc(127 * var(--u));justify-content:center}.potion-pill strong{font-size:clamp(20px,calc(25 * var(--u)),25px)}
.hud-icon{width:calc(39 * var(--u));height:calc(39 * var(--u))}.potion-pill .hud-icon{width:calc(29 * var(--u));height:calc(39 * var(--u))}
.garden-status{position:absolute;left:50%;transform:translateX(-50%);width:calc(381 * var(--u));justify-content:center;min-height:calc(43 * var(--u));font-size:clamp(15px,calc(22 * var(--u)),22px)}.garden-status img,.garden-status svg{width:calc(28 * var(--u));height:calc(28 * var(--u))}
.square-button{width:calc(49 * var(--u));height:calc(48 * var(--u));min-width:38px;min-height:38px;padding:calc(9 * var(--u));display:grid;place-items:center;border-radius:calc(14 * var(--u));background:#f4f2e3}.square-button img,.square-button svg{width:100%;height:100%}
#save-status{min-width:calc(122 * var(--u));min-height:calc(43 * var(--u));justify-content:center;font-size:clamp(13px,calc(18 * var(--u)),18px)}.save-error{color:#a24b34!important}.save-error.hud-pill{background:#fff0d6}.world-label{display:none}
.quest-board{position:fixed;left:var(--edge);top:calc(112 * var(--u));z-index:25;width:calc(223 * var(--u));min-height:calc(160 * var(--u));padding:calc(21 * var(--u)) calc(22 * var(--u)) calc(12 * var(--u));background:url("../assets/ui/quest-board.png") center / 100% 100% no-repeat;font-weight:700;pointer-events:none}
.quest-header{display:flex;align-items:center;gap:calc(7 * var(--u));font-size:clamp(15px,calc(20 * var(--u)),20px);line-height:1.3;padding-bottom:calc(9 * var(--u));border-bottom:1px solid #d6c8a980}.quest-header img,.quest-header svg{width:calc(23 * var(--u));height:calc(23 * var(--u))}
.quest-item{display:grid;grid-template-columns:calc(42 * var(--u)) minmax(0,1fr) auto;align-items:center;gap:calc(8 * var(--u));min-height:calc(55 * var(--u));font-size:clamp(14px,calc(20 * var(--u)),20px);border-bottom:1px solid #d6c8a970}.quest-item img,.quest-item svg{width:calc(38 * var(--u));height:calc(38 * var(--u))}
.quest-reward{display:flex;align-items:center;justify-content:center;gap:calc(8 * var(--u));padding-top:calc(7 * var(--u));font-size:clamp(16px,calc(22 * var(--u)),22px)}.quest-reward img,.quest-reward svg{width:calc(28 * var(--u));height:calc(28 * var(--u))}.quest-board>small{display:block;margin-top:4px;text-align:center;font-size:12px;font-weight:400;color:#748064}
/* Quickbar: large artwork above a label, quantity at the artwork's lower right. */
.quickbar{position:fixed;left:50%;bottom:max(calc(23 * var(--u)),env(safe-area-inset-bottom));transform:translateX(-50%);z-index:30;display:grid;justify-items:center;gap:calc(9 * var(--u));pointer-events:none}
#garden-hint{max-width:85vw;padding:6px 14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:16px;background:#42633199;color:#fffdeb;text-shadow:0 1px 1px #2f492d;font-size:clamp(12px,calc(15 * var(--u)),15px)}#garden-hint:empty{display:none}
.seed-dock{display:flex;align-items:flex-start;gap:calc(12 * var(--u));padding:calc(8 * var(--u)) calc(12 * var(--u)) calc(4 * var(--u));border-radius:14px;background:#58763025;pointer-events:auto}
.seed-slot{position:relative;width:calc(80 * var(--u));height:calc(104 * var(--u));display:flex;flex-direction:column;align-items:center;gap:calc(6 * var(--u));padding:0;border:0;background:none;box-shadow:none;overflow:visible}.seed-slot:hover:not(:disabled){filter:none}
.slot-art{width:100%;height:calc(80 * var(--u));flex-shrink:0;display:grid;place-items:center;border:1px solid #d7d3b5;border-radius:calc(10 * var(--u));background:linear-gradient(#f6f4e5ee,#e7e9cded);box-shadow:0 2px 2px #40502c12}.seed-slot.active .slot-art{border:2px solid var(--gold);background:linear-gradient(#fffbea,#faf3d6);box-shadow:0 0 0 2px #fff8d8,0 0 11px #ffc73888}
.slot-key{position:absolute;left:calc(3 * var(--u));top:calc(1 * var(--u));z-index:2;min-width:calc(22 * var(--u));padding:0 3px;border:1px solid #f3f3d8;border-radius:5px;background:#687658;color:white;font-family:inherit;font-size:clamp(12px,calc(19 * var(--u)),19px);font-weight:700;line-height:1.25;text-align:center}
.slot-art>.crop-icon{width:calc(47 * var(--u));height:calc(59 * var(--u))}.seed-icon{display:grid;place-items:center;width:calc(56 * var(--u));height:calc(67 * var(--u));background:var(--packet) center / contain no-repeat;transform:rotate(8deg)}.seed-icon>.crop-icon{width:60%;height:60%;margin-top:10%}
.harvest-icon{display:grid;place-items:center;width:calc(62 * var(--u));height:calc(62 * var(--u))}.harvest-icon .crop-icon{width:90%;height:90%}
.seed-quantity{position:absolute;right:calc(6 * var(--u));top:calc(54 * var(--u));z-index:2;font-size:clamp(15px,calc(22 * var(--u)),22px);line-height:1.1;font-weight:700;color:#2c4430;text-shadow:0 1px 1px #fffde8}.seed-name{font-size:clamp(13px,calc(18 * var(--u)),18px);line-height:1.25;font-weight:700;color:#fffde6;text-shadow:0 1px 2px #364e2e;white-space:nowrap}.empty-slot .slot-art{color:#c0bca0;font-size:calc(45 * var(--u));font-weight:700}
.game-actions{position:fixed;right:var(--edge);bottom:max(calc(34 * var(--u)),env(safe-area-inset-bottom));z-index:30;display:flex;gap:calc(16 * var(--u))}.game-actions button{position:relative;width:calc(68 * var(--u));height:calc(83 * var(--u));display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(5 * var(--u));padding:calc(7 * var(--u)) calc(4 * var(--u));border:1px solid #dedbc2;border-radius:calc(13 * var(--u));background:#f8f5e2ef;box-shadow:none;font-size:clamp(13px,calc(18 * var(--u)),18px);font-weight:700}.game-actions img,.game-actions svg{width:calc(37 * var(--u));height:calc(41 * var(--u))}.game-actions button.active{border:2px solid var(--gold);box-shadow:0 0 0 2px #fff8dc,0 0 12px #ffcd4380}.game-actions b{position:absolute;top:-6px;right:-5px;min-width:20px;padding:1px 4px;border:2px solid #f4f2df;border-radius:12px;background:#547345;color:white;font-size:12px;line-height:16px}.game-actions b:empty{display:none}
#movement-help{position:fixed;left:var(--edge);bottom:calc(30 * var(--u));max-width:calc(375 * var(--u));z-index:25;display:flex;align-items:center;gap:calc(5 * var(--u));padding:calc(9 * var(--u)) calc(15 * var(--u));border-radius:24px;background:#4d672f99;color:#fffbe5;font-size:clamp(12px,calc(16 * var(--u)),16px);line-height:1.4;pointer-events:none;white-space:nowrap}#movement-help kbd{padding:0 3px;border:1px solid #dce4bb8c;border-radius:4px;font:inherit;font-weight:700}.help-divider{width:1px;height:18px;background:#dce4bb66;margin:0 7px}
/* Window sizes and placement match the 1672 x 941 reference composition. */
#panel-overlay{position:fixed;inset:0;z-index:20;display:flex;justify-content:flex-end;align-items:center;padding:0 10vw calc(50 * var(--u)) 3vw;background:#2948290b}
#game-window{width:calc(1005 * var(--u));height:calc(662 * var(--u));max-width:94vw;max-height:calc(100dvh - 185 * var(--u));display:flex;flex-direction:column;overflow:hidden;outline:none;border:1px solid #b9b596;border-radius:calc(22 * var(--u));background-color:var(--cream);background-image:linear-gradient(110deg,#fffdf488,#f4efdb33),var(--paper);background-position:center;background-size:100% 100%,calc(100% + 160px) calc(100% + 160px);box-shadow:0 3px 6px #3b4b2b26;font-size:clamp(15px,calc(21 * var(--u)),21px)}
#game-window[data-panel="bag"]{width:calc(889 * var(--u));height:calc(642 * var(--u))}#game-window[data-panel="garden"]{width:max(340px,calc(465 * var(--u)));height:auto;max-height:calc(100dvh - 210 * var(--u))}#game-window[data-panel="settings"]{width:max(480px,calc(720 * var(--u)));height:auto}#game-window[data-panel="tools"]{width:calc(900 * var(--u));height:auto}
.window-header{display:flex;justify-content:space-between;align-items:center;gap:18px;flex-shrink:0;min-height:calc(78 * var(--u));margin:0 calc(25 * var(--u));padding:calc(16 * var(--u)) 0 calc(12 * var(--u));border-bottom:1px solid #d4cdb489}.window-header>div{display:flex;align-items:center;gap:calc(19 * var(--u));min-width:0}.window-header h1{font-size:clamp(27px,calc(42 * var(--u)),42px);font-weight:700;line-height:1.15;letter-spacing:1px}#window-icon{display:block;width:calc(48 * var(--u));height:calc(51 * var(--u));flex-shrink:0}#window-icon>img,#window-icon>svg{width:100%;height:100%}
#panel-close{display:grid;place-items:center;width:calc(52 * var(--u));height:calc(52 * var(--u));min-width:38px;min-height:38px;padding:0;border:1px solid #d1c9ae;border-radius:calc(12 * var(--u));background:#f6f1e0;font:600 clamp(30px,calc(44 * var(--u)),44px)/1 system-ui,sans-serif;box-shadow:none}
#panel-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:calc(14 * var(--u)) calc(24 * var(--u)) calc(20 * var(--u));scrollbar-width:thin;scrollbar-color:#bbb999 transparent}#game-window[data-panel="bag"] #panel-content{padding:calc(14 * var(--u)) calc(30 * var(--u)) calc(18 * var(--u))}
.window-footer{flex-shrink:0;display:flex;justify-content:space-between;gap:12px;padding:7px calc(26 * var(--u));border-top:1px solid #ddd5ba7a;color:#858570;font-size:12px;line-height:1.35}#game-window[data-panel="shop"] .window-footer,#game-window[data-panel="bag"] .window-footer{display:none}
.panel-tabs{display:flex;gap:calc(14 * var(--u));flex-shrink:0;min-height:calc(50 * var(--u));margin-bottom:calc(13 * var(--u))}.panel-tabs button{flex:1;min-width:0;min-height:38px;padding:calc(7 * var(--u)) calc(12 * var(--u));border-radius:calc(12 * var(--u));background:#e9e4d1;font-size:clamp(15px,calc(23 * var(--u)),23px);font-weight:700}.panel-tabs button.active,.panel-tabs button[aria-pressed="true"]{color:#fffef2;background:linear-gradient(#618358,#45673f);border-color:#59734d}
/* Shop: selectable cards and a single purchase column. */
.shop-layout{height:100%;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) calc(378 * var(--u));gap:calc(20 * var(--u));align-items:stretch}.shop-main{min-width:0;min-height:0;display:flex;flex-direction:column}.shop-main .panel-tabs{width:67%}
.shop-list{flex:1;min-height:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:calc(12 * var(--u))}
.shop-item{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(5 * var(--u));padding:calc(10 * var(--u)) calc(9 * var(--u));border:1px solid #d9d1b8;border-radius:calc(13 * var(--u));background:linear-gradient(110deg,#f8f5e8,#f0ebd9);text-align:center}
.shop-item.active,.shop-item[aria-pressed="true"]{border:2px solid var(--gold);padding:calc(10 * var(--u) - 1px) calc(9 * var(--u) - 1px);background:linear-gradient(#fffbed,#faf2d8);box-shadow:0 0 0 2px #fff9e0,0 0 9px #ffd24450}
.crop-art{display:grid;place-items:center;flex-shrink:0}.shop-item .crop-art{width:calc(98 * var(--u));height:calc(108 * var(--u))}.shop-item .crop-art>.seed-icon{width:100%;height:100%}
.shop-copy strong{display:block;font-size:clamp(16px,calc(24 * var(--u)),24px);font-weight:700;line-height:1.25;white-space:nowrap}.shop-copy small{display:block;margin-top:calc(4 * var(--u));color:#69745d;font-size:clamp(13px,calc(19 * var(--u)),19px);line-height:1.3}
.card-price{display:flex;align-items:center;justify-content:center;gap:calc(7 * var(--u));margin-top:calc(3 * var(--u));font-size:clamp(17px,calc(24 * var(--u)),24px);font-weight:700;line-height:1.2}.card-price .crop-icon{width:calc(32 * var(--u));height:calc(32 * var(--u))}.shop-item.sold-out{opacity:.55}
.shop-main>.stock-time{flex-shrink:0;margin-top:calc(7 * var(--u));padding:0;background:none;text-align:center;font-size:clamp(12px,calc(15 * var(--u)),15px);line-height:1.3;color:#7b806b}
.shop-detail{min-width:0;display:flex;flex-direction:column;align-items:center;gap:calc(6 * var(--u));padding:calc(11 * var(--u)) calc(24 * var(--u));border:1px solid #dfd6ba;border-radius:calc(14 * var(--u));background:linear-gradient(120deg,#f1ecd9b0,#eee7d266)}
.detail-art{display:grid;place-items:center;flex-shrink:0;width:calc(150 * var(--u));height:calc(151 * var(--u));margin:0 auto}.detail-art>.crop-icon{width:90%;height:90%}.detail-art>.seed-icon{width:88%;height:100%}.shop-detail .detail-art{width:calc(132 * var(--u));height:calc(130 * var(--u))}
.detail-name{font-size:clamp(21px,calc(31 * var(--u)),31px);font-weight:700;line-height:1.15;text-align:center}
.detail-facts{width:100%;font-size:clamp(15px,calc(21 * var(--u)),21px);line-height:1.25}.detail-facts>div{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:calc(39 * var(--u));padding:calc(4 * var(--u)) 0;border-bottom:1px solid #d7ceb67a}.detail-facts span{display:flex;align-items:center;gap:calc(10 * var(--u));color:#66705d}.detail-facts strong{display:flex;align-items:center;gap:calc(9 * var(--u));font-variant-numeric:tabular-nums;white-space:nowrap}.detail-facts .crop-icon{width:calc(29 * var(--u));height:calc(29 * var(--u))}.shop-detail .detail-facts>div{min-height:calc(34 * var(--u))}
.quantity-control{display:flex;align-items:center;justify-content:center;gap:calc(7 * var(--u));width:100%;margin:calc(2 * var(--u)) 0}.quantity-control button{width:calc(52 * var(--u));height:calc(44 * var(--u));min-width:38px;min-height:36px;padding:0;color:#fffdf2;border-color:#53744c;background:linear-gradient(#65875a,#466e42);font-size:clamp(24px,calc(34 * var(--u)),34px);line-height:1}
.quantity-control input{width:calc(145 * var(--u));min-width:55px;height:calc(44 * var(--u));min-height:36px;border:1px solid #cec5ab;border-radius:calc(10 * var(--u));background:#fdf9eb;color:var(--ink);font-size:clamp(17px,calc(25 * var(--u)),25px);font-weight:700;text-align:center;appearance:textfield}.quantity-control input::-webkit-inner-spin-button,.quantity-control input::-webkit-outer-spin-button{appearance:none;margin:0}
.detail-total{width:100%;display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:auto;padding-top:calc(7 * var(--u));border-top:1px solid #cdc3aa;font-size:clamp(17px,calc(24 * var(--u)),24px);font-weight:700}.detail-total strong{display:flex;align-items:center;gap:calc(9 * var(--u))}.detail-total .crop-icon{width:calc(33 * var(--u));height:calc(33 * var(--u))}.shop-detail>.primary{width:100%;min-height:calc(47 * var(--u));padding:calc(7 * var(--u));font-size:clamp(18px,calc(25 * var(--u)),25px)}.detail-footnote{color:#777d68;font-size:clamp(13px,calc(18 * var(--u)),18px);line-height:1.25;text-align:center}
/* Inventory: four-column grid with independent selected-item details. */
.inventory-layout{height:100%;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) calc(255 * var(--u));gap:calc(26 * var(--u))}.inventory-main{display:flex;flex-direction:column;min-width:0;min-height:0}
.inventory-grid{flex:1;min-height:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:calc((100% - 30 * var(--u)) / 3);align-content:start;gap:calc(15 * var(--u)) calc(17 * var(--u));overflow-y:auto;overflow-x:hidden;padding:3px;scrollbar-width:thin}
.inventory-slot{position:relative;min-width:0;min-height:0;display:grid;place-items:center;padding:calc(11 * var(--u));border:1px solid #d9d1bb;border-radius:calc(11 * var(--u));background:linear-gradient(120deg,#f3efdf,#ece6d4)}.inventory-slot.active,.inventory-slot[aria-pressed="true"]{border:2px solid var(--gold);padding:calc(11 * var(--u) - 1px);background:#fbf4df;box-shadow:0 0 0 1px #fff5d3,0 0 9px #ffc63d66}
.item-art{display:grid;place-items:center;width:calc(86 * var(--u));height:calc(88 * var(--u));max-width:90%;max-height:95%}.item-art>.crop-icon{width:95%;height:95%}.item-art .seed-icon{width:calc(71 * var(--u));height:calc(87 * var(--u));max-width:100%;max-height:100%}
.item-count{position:absolute;right:calc(11 * var(--u));bottom:calc(6 * var(--u));font-size:clamp(17px,calc(23 * var(--u)),23px);font-weight:700;color:#314a34;text-shadow:0 1px 1px #fffbe7}.item-lock{position:absolute;left:7px;top:5px;font-size:14px;color:#667158}.inventory-slot.empty-item{color:#c8c0a5;font-size:calc(49 * var(--u));font-weight:700;cursor:default}
.inventory-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-shrink:0;min-height:calc(53 * var(--u));margin-top:calc(14 * var(--u));font-size:clamp(17px,calc(24 * var(--u)),24px);font-weight:700}.inventory-footer button{min-width:calc(146 * var(--u));min-height:calc(49 * var(--u));padding:calc(8 * var(--u)) calc(16 * var(--u));font-size:clamp(15px,calc(22 * var(--u)),22px)}
.inventory-detail{min-width:0;display:flex;flex-direction:column;align-items:center;gap:calc(10 * var(--u));padding:calc(13 * var(--u)) 0 0 calc(24 * var(--u));border-left:1px solid #d5cdb5}.inventory-detail .detail-name{font-size:clamp(22px,calc(29 * var(--u)),29px)}
.quality-tag{display:inline-block;padding:calc(4 * var(--u)) calc(21 * var(--u));border-radius:20px;background:#bfd099;color:#486139;font-size:clamp(15px,calc(20 * var(--u)),20px);line-height:1.15;font-weight:700;text-align:center}.inventory-detail .detail-facts{margin-top:calc(3 * var(--u))}.detail-actions{display:grid;gap:calc(11 * var(--u));width:100%;margin-top:auto}.detail-actions button{width:100%;min-height:calc(49 * var(--u));padding:calc(8 * var(--u));font-size:clamp(16px,calc(22 * var(--u)),22px)}.detail-actions p{font-size:clamp(13px,calc(18 * var(--u)),18px);text-align:center;color:#6f7961;line-height:1.4}
/* Existing cultivation, settings, tools, and catalog remain functional. */
.panel-kicker{display:none}.panel-intro{color:var(--muted);font-size:16px;line-height:1.7;margin:7px 0 15px}.panel-note{margin-top:20px;padding-top:13px;border-top:1px solid var(--line);color:#7e826c;font-size:13px;line-height:1.7}
.feature-card{border:1px solid #d7d3bc;border-radius:13px;background:#f3efdd;padding:20px;margin:18px 0}.feature-card p{color:#768266;font-size:15px;line-height:1.75;margin-top:10px}.feature-card .big-icon{display:block;margin-bottom:10px}.big-icon .crop-icon{width:48px;height:48px}
#game-window[data-panel="tools"] #panel-content{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}#game-window[data-panel="tools"] #panel-content>h2,#game-window[data-panel="tools"] #panel-content>.panel-intro,#game-window[data-panel="tools"] #panel-content>.panel-note{grid-column:1/-1}#game-window[data-panel="tools"] .feature-card{margin:0;padding:18px}
.plant-header{display:flex;align-items:center;gap:15px;margin-bottom:15px}.plant-header .crop-art{width:64px;height:64px;background:#e7e9cf;border:1px solid #d4d9ba;border-radius:12px}.plant-header .crop-icon{width:52px;height:52px}.plant-header .panel-intro{font-size:14px;margin-bottom:0}
.stage-track{display:flex;gap:6px;margin:17px 0 9px}.stage-step{flex:1;font-size:13px;color:#989d83}.stage-step::before{content:"";display:block;height:5px;margin-bottom:8px;border-radius:4px;background:#dfdfc9}.stage-step.done::before{background:#82a965}.stage-step.current{color:#486a3b;font-weight:700}.stage-step.current::before{background:#527746}
.timer-row{display:flex;justify-content:space-between;gap:10px;margin-top:16px;color:#768568;font-size:14px}.timer-row strong{color:#416139}.progress{height:5px;overflow:hidden;margin-top:9px;border-radius:4px;background:#dfe2cc}.progress>span{display:block;height:100%;background:#91ac68}
.potion-card{border:1px solid #d2dbb8;border-radius:13px;padding:16px;margin-top:20px;background:#e9edd7}.potion-top{display:flex;align-items:center;justify-content:space-between;gap:9px}.potion-top span{font-size:14px;color:#7b8a63}.potion-card p{font-size:14px;line-height:1.7;color:#7b886a;margin-top:8px}.odds{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin:15px 0}.odds div{font-size:13px;color:#7c886c;text-align:center}.odds strong{display:block;font-size:18px;margin-top:5px;color:#47653c}.potion-card button{width:100%;font-size:16px}.potion-result{font-size:14px;line-height:1.5;margin-top:8px;color:#6b814f}
.fruit-list{display:grid;gap:10px;margin-top:15px}.fruit-row{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:10px;background:#faf7e988;font-size:15px}.fruit-row .crop-icon{width:38px;height:38px}.fruit-detail{flex:1;min-width:0}.fruit-row small{display:block;font-size:13px;line-height:1.65;color:#7b836a}.fruit-row button{padding:9px 11px;font-size:14px}.tag{display:inline-block;margin-top:3px;padding:2px 5px;border-radius:4px;background:#e4ddbd;font-size:12px}
.text-button{border:0;background:none;box-shadow:none;padding:8px 0;text-decoration:underline;font-size:14px;color:#718064}.button-row{display:flex;gap:10px;margin-top:14px}.button-row>*{flex:1;min-width:0}.full{width:100%;margin-top:14px}.empty{padding:30px 10px;color:#858a72;font-size:15px;line-height:1.8;text-align:center}
.setting-row{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:20px 0}.setting-row label{font-size:17px}.setting-row select{max-width:58%;padding:10px 14px;border:1px solid var(--line);border-radius:8px;background:#fffbee;color:#44643e;font-size:16px}.note-box{padding:15px;margin:17px 0;border-radius:10px;background:#e8e4cf88;color:#81826b;font-size:14px;line-height:1.75}.danger{color:#a46044;border-color:#d9bd9c;background:#f8eddb}
.stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}.stats-grid>div{display:flex;align-items:center;gap:12px;padding:14px;border-radius:10px;background:#e8e9d5;font-size:14px;color:#859073}.stats-grid strong{font-size:24px;color:#527447}.steps{display:grid;gap:17px;margin:22px 0}.step{display:flex;gap:14px}.step-number{font-size:22px;color:#91a375}.step b{font-size:15px}.step p{font-size:14px;color:#818a71;margin-top:5px}
.catalog-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.catalog-card{min-width:0;display:flex;flex-direction:column;align-items:center;gap:10px;padding:18px;border:1px solid #d8cfb7;border-radius:12px;background:#f4efde;text-align:center}.catalog-card>.crop-icon,.catalog-card .crop-art{width:80px;height:93px}.catalog-card .crop-art>.seed-icon{width:100%;height:100%}.catalog-card h2,.catalog-card strong{font-size:20px}.catalog-card small,.catalog-card p{font-size:14px;line-height:1.6;color:#758066}
#toast{position:fixed;top:90px;left:50%;z-index:60;max-width:90vw;padding:12px 22px;border:1px solid #dce5b75e;border-radius:12px;background:#304f37ef;color:#fffbe6;box-shadow:0 5px 20px #243e3029;font-size:15px;line-height:1.6;text-align:center;opacity:0;transform:translate(-50%,-10px);transition:opacity .15s,transform .15s;pointer-events:none}#toast.show{opacity:1;transform:translate(-50%,0)}
dialog{width:calc(100% - 36px);max-width:460px;max-height:85dvh;padding:28px;overflow:auto;border:1px solid #b9b596;border-radius:18px;background:#f8f3e3;color:#354e39;box-shadow:0 15px 50px #183c3433}dialog::backdrop{background:#29483144;backdrop-filter:blur(2px)}dialog p{font-size:16px;line-height:1.75;white-space:pre-line;margin:16px 0 22px;color:#7a846a}dialog>button{width:100%;font-size:17px}.dialog-art{width:45px;height:45px;margin-bottom:15px}
#touch-controls{position:absolute;inset:0;display:none;z-index:5;pointer-events:none}#joystick{position:absolute;left:24px;bottom:145px;width:100px;height:100px;border:2px solid #fffce9b0;border-radius:50%;background:#4b663650;display:grid;place-items:center;touch-action:none;pointer-events:auto}#joystick-knob{width:43px;height:43px;border:2px solid #fffbe8d0;border-radius:50%;background:#fffbe9b5;pointer-events:none}
/* Compact layouts keep every purchase/detail action reachable by scrolling. */
@media(max-width:1100px){
  :root{--u:.7px}.garden-status{width:max-content;min-width:calc(335 * var(--u));font-size:15px}#movement-help{display:none}#panel-overlay{padding-right:4vw;padding-left:4vw}#game-window{max-width:92vw}
}
@media(pointer:coarse){#touch-controls{display:block}#movement-help{display:none}}
@media(max-width:760px){
  :root{--u:.66px;--edge:12px}
  .game-hud{top:max(12px,env(safe-area-inset-top))}.hud-resources,.hud-system{gap:7px}.hud-pill{min-height:37px;padding:5px 8px;font-size:15px;border-radius:10px}.coin-pill{width:101px;padding-left:6px;gap:7px}.coin-pill strong{font-size:20px}.potion-pill{min-width:76px;gap:6px}.potion-pill strong{font-size:18px}.hud-icon{width:29px;height:29px}.potion-pill .hud-icon{width:23px;height:29px}
  #save-status{min-width:64px;max-width:98px;font-size:12px;white-space:normal}.square-button{width:38px;height:38px;padding:7px}.garden-status{top:49px;width:auto;max-width:90vw;min-width:218px;min-height:32px;font-size:14px;padding:5px 10px}.garden-status img,.garden-status svg{width:23px;height:23px}.quest-board{display:none}
  .quickbar{bottom:max(10px,env(safe-area-inset-bottom));gap:6px}.seed-dock{gap:6px;padding:6px 8px 3px}.seed-slot{width:49px;height:70px;gap:4px}.slot-art{height:49px;border-radius:8px}.seed-icon{width:37px;height:45px}.slot-art>.crop-icon{width:32px;height:39px}.harvest-icon{width:39px;height:39px}.slot-key{font-size:12px;line-height:16px;min-width:17px;top:0;left:1px;border-radius:4px}.seed-name{font-size:12px;line-height:16px}.seed-quantity{font-size:16px;right:4px;top:31px}#garden-hint{font-size:12px;max-width:92vw;padding:5px 11px}
  .game-actions{right:14px;bottom:128px;gap:8px}.game-actions button{width:47px;height:61px;font-size:12px;gap:3px;border-radius:10px}.game-actions img,.game-actions svg{width:29px;height:32px}#joystick{left:19px;bottom:143px;width:88px;height:88px}#station-prompt{top:47%;left:50%;padding:10px 13px;font-size:14px}
  #panel-overlay{padding:95px 12px 205px;align-items:stretch;justify-content:center}#game-window,#game-window[data-panel="bag"],#game-window[data-panel="garden"],#game-window[data-panel="settings"],#game-window[data-panel="tools"]{width:100%;max-width:100%;height:100%;max-height:100%;border-radius:15px}
  .window-header{min-height:60px;margin:0 15px;padding:11px 0;gap:10px}.window-header>div{gap:10px}.window-header h1{font-size:25px}#window-icon{width:31px;height:34px}#panel-close{width:36px;height:36px;min-width:36px;min-height:36px;font-size:32px;border-radius:8px}#panel-content,#game-window[data-panel="bag"] #panel-content{padding:13px 14px 17px}.window-footer{font-size:12px;padding:7px 14px}
  .shop-layout,.inventory-layout{height:auto;min-height:0;display:flex;flex-direction:column;gap:16px}.shop-main,.inventory-main{min-height:0;overflow:visible}.panel-tabs{min-height:37px;gap:7px;margin-bottom:10px}.panel-tabs button{min-height:37px;padding:6px;font-size:15px;border-radius:8px}.shop-main .panel-tabs{width:70%}
  .shop-list{flex:none;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(148px,auto));gap:8px}.shop-item,.shop-item.active{padding:9px 5px;gap:4px;border-radius:9px}.shop-item .crop-art{width:55px;height:69px}.shop-copy strong{font-size:14px}.shop-copy small{font-size:12px;line-height:1.4;margin-top:3px}.card-price{font-size:16px;gap:5px}.card-price .crop-icon{width:24px;height:24px}
  .shop-detail,.inventory-detail{display:grid;grid-template-columns:80px minmax(0,1fr);align-items:center;gap:10px;padding:14px;border:1px solid var(--line);border-radius:10px;background:#f1ecd9;min-width:0}.shop-detail .detail-art,.inventory-detail .detail-art{grid-column:1;grid-row:1/3;width:75px;height:94px;margin:0}.detail-name,.inventory-detail .detail-name{grid-column:2;font-size:21px;text-align:left}.quality-tag{grid-column:2;justify-self:start;font-size:14px;padding:4px 13px}
  .detail-facts,.inventory-detail .detail-facts{grid-column:1/-1;margin:0;font-size:15px}.detail-facts>div,.shop-detail .detail-facts>div{min-height:34px;padding:5px 0}.detail-facts .crop-icon{width:23px;height:23px}.quantity-control,.detail-total,.shop-detail>.primary,.detail-footnote,.detail-actions{grid-column:1/-1;width:100%}.quantity-control button,.quantity-control input{height:42px;min-height:42px}.quantity-control button{width:44px;min-width:44px;font-size:29px}.quantity-control input{width:128px;font-size:20px}.detail-total{margin-top:0;padding-top:9px;font-size:18px}.detail-total .crop-icon{width:27px;height:27px}.shop-detail>.primary{min-height:43px;font-size:20px}.detail-footnote{font-size:13px}
  .inventory-grid{flex:none;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:auto;gap:8px;overflow:visible}.inventory-slot{aspect-ratio:1;min-height:0;padding:7px;border-radius:8px}.inventory-slot.active{padding:6px}.item-art{width:56px;height:58px;max-width:90%;max-height:95%}.item-art .seed-icon{width:43px;height:53px}.item-count{right:6px;bottom:4px;font-size:16px}.inventory-slot.empty-item{font-size:35px}.inventory-footer{min-height:41px;margin-top:10px;font-size:17px}.inventory-footer button{min-height:38px;min-width:100px;font-size:15px;padding:7px 12px}.detail-actions{gap:9px;margin-top:0}.detail-actions button{min-height:42px;font-size:17px}.detail-actions p{font-size:13px}
  #game-window[data-panel="tools"] #panel-content{display:block}#game-window[data-panel="tools"] .feature-card{margin:14px 0}.feature-card{padding:15px}.panel-intro{font-size:14px}.panel-note{font-size:13px}.setting-row{gap:12px;margin:17px 0}.setting-row label,.setting-row select{font-size:15px}.setting-row select{padding:8px;max-width:58%}.catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.catalog-card{padding:13px 9px}.catalog-card>.crop-icon,.catalog-card .crop-art{width:63px;height:76px}.catalog-card h2,.catalog-card strong{font-size:18px}.catalog-card small,.catalog-card p{font-size:13px}#toast{top:88px;font-size:14px;padding:10px 16px}
}
@media(max-height:550px){
  :root{--u:.6px;--edge:14px}.game-hud{top:10px}.hud-resources,.hud-system{gap:7px}.hud-pill{min-height:34px;padding:4px 9px;font-size:14px}.coin-pill{width:95px;padding-left:5px;gap:6px}.coin-pill strong{font-size:20px}.potion-pill{min-width:74px;gap:6px}.potion-pill strong{font-size:18px}.hud-icon{width:27px;height:27px}.potion-pill .hud-icon{width:21px;height:28px}.square-button{width:35px;height:35px;min-width:35px;min-height:35px;padding:6px}.garden-status{top:0;min-width:230px;width:max-content;min-height:34px;font-size:14px}#save-status{min-width:72px;max-width:110px;min-height:34px;font-size:12px}.quest-board,#movement-help{display:none}
  .quickbar{left:46%;bottom:9px;gap:4px}.seed-dock{gap:6px;padding:5px 8px 2px}.seed-slot{width:46px;height:65px;gap:3px}.slot-art{height:46px;border-radius:8px}.seed-icon{width:34px;height:41px}.slot-art>.crop-icon{width:30px;height:36px}.harvest-icon{width:36px;height:36px}.seed-name{font-size:12px;line-height:16px}.slot-key{font-size:11px;min-width:16px;line-height:15px;top:0;left:1px}.seed-quantity{font-size:15px;right:4px;top:29px}#garden-hint{font-size:12px;padding:3px 10px}.game-actions{right:14px;bottom:13px;gap:7px}.game-actions button{width:43px;height:56px;font-size:12px;gap:3px;padding:5px 3px;border-radius:9px}.game-actions img,.game-actions svg{width:27px;height:29px}
  #joystick{left:20px;bottom:24px;width:78px;height:78px}#joystick-knob{width:36px;height:36px}
  #panel-overlay{padding:54px 16px 112px;align-items:stretch;justify-content:center}#game-window,#game-window[data-panel="bag"],#game-window[data-panel="garden"],#game-window[data-panel="settings"],#game-window[data-panel="tools"]{width:min(820px,94vw);max-width:100%;height:100%;max-height:100%;border-radius:12px}.window-header{min-height:47px;margin:0 15px;padding:7px 0}.window-header h1{font-size:23px}#window-icon{width:29px;height:31px}#panel-close{width:33px;height:33px;min-width:33px;min-height:33px;font-size:29px}#panel-content,#game-window[data-panel="bag"] #panel-content{padding:11px 15px 16px}.window-footer{font-size:12px;padding:6px 15px}
  .shop-layout{height:auto;display:grid;grid-template-columns:minmax(0,1fr) 225px;gap:14px;align-items:start}.shop-main .panel-tabs{width:75%}.panel-tabs{min-height:36px;gap:8px;margin-bottom:10px}.panel-tabs button{min-height:36px;padding:6px;font-size:15px}.shop-list{flex:none;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(150px,auto));gap:8px}.shop-item,.shop-item.active{padding:8px 5px;gap:4px}.shop-item .crop-art{width:53px;height:65px}.shop-copy strong{font-size:14px}.shop-copy small{font-size:12px}.card-price{font-size:16px}.card-price .crop-icon{width:23px;height:23px}
  .shop-detail{display:flex;flex-direction:column;padding:12px;gap:9px}.shop-detail .detail-art{width:78px;height:97px}.detail-name,.inventory-detail .detail-name{font-size:20px}.detail-facts{font-size:14px}.detail-facts>div,.shop-detail .detail-facts>div{min-height:33px;padding:5px 0}.quantity-control button,.quantity-control input{height:38px;min-height:38px}.quantity-control input{width:89px;font-size:18px}.quantity-control button{width:38px;min-width:38px;font-size:28px}.detail-total{font-size:17px;padding-top:9px}.shop-detail>.primary{min-height:40px;font-size:18px}.detail-footnote{font-size:12px}
  .inventory-layout{height:auto;display:grid;grid-template-columns:minmax(0,1fr) 205px;gap:15px}.inventory-grid{flex:none;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:auto;gap:9px;overflow:visible}.inventory-slot{aspect-ratio:1;padding:7px}.item-art{width:53px;height:56px;max-width:90%;max-height:95%}.item-art .seed-icon{width:42px;height:52px}.item-count{font-size:16px;bottom:4px;right:6px}.inventory-slot.empty-item{font-size:34px}.inventory-detail{display:flex;flex-direction:column;gap:9px;padding:10px 0 0 14px;border:0;border-left:1px solid var(--line);border-radius:0;background:none}.inventory-detail .detail-art{width:86px;height:95px}.inventory-footer{font-size:16px;margin-top:10px;min-height:38px}.inventory-footer button{min-height:36px;font-size:14px}.detail-actions button{min-height:38px;font-size:16px}.quality-tag{font-size:14px;padding:4px 14px}#toast{top:54px;font-size:14px}#station-prompt{top:45%;font-size:14px}
}
@media(max-width:570px) and (max-height:550px){
  .garden-status{display:none}.shop-layout,.inventory-layout{display:flex;flex-direction:column}.shop-detail,.inventory-detail{width:100%;border:1px solid var(--line);border-radius:10px;padding:12px;background:#f1ecd9}.quickbar{left:50%}.game-actions{right:12px;bottom:93px;gap:6px}.game-actions button{width:40px;height:50px;font-size:11px}.game-actions img,.game-actions svg{width:24px;height:25px}#panel-overlay{padding-bottom:160px}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

