:root{--ui:1;--min-font:0px}
:root{font-family:'Microsoft JhengHei','PingFang TC',sans-serif;color:#284b43;background:#b7d7ce;font-size:max(var(--min-font,0px),calc(16px * var(--ui)));font-weight:500;--green:#2f6151;--cream:#fff9e9;--ink:#284b43;--gold:#d3a450}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;border:0;border-radius:calc(14px * var(--ui));padding:calc(12px * var(--ui)) calc(19px * var(--ui));color:var(--ink);background:#eee8d6;font-weight:700;min-height:calc(46px * var(--ui));transition:background .15s,transform .15s}button:hover{background:#e0e7ce}button:active{transform:scale(.97)}button:disabled{cursor:default;opacity:.48}button:focus-visible,input:focus-visible,select:focus-visible{outline:calc(3px * var(--ui)) solid #d3a450;outline-offset:calc(3px * var(--ui))}input,select{width:100%;padding:calc(12px * var(--ui));border:calc(1px * var(--ui)) solid #cccbb7;border-radius:calc(12px * var(--ui));background:#fffdf6;color:var(--ink);margin-top:calc(7px * var(--ui))}label{display:block;margin:calc(12px * var(--ui)) 0}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(calc(30px * var(--ui)),4vw,calc(52px * var(--ui)));letter-spacing:.04em}h2{font-size:max(var(--min-font,0px),calc(27px * var(--ui)))}h3{font-size:max(var(--min-font,0px),calc(19px * var(--ui)));margin-bottom:calc(8px * var(--ui))}p{line-height:1.8;color:#627468}.primary{background:var(--green);color:#fffbea}.primary:hover{background:#3f7661}.gold{background:#e7c373}.quiet{background:#ffffffa8}.small{font-size:max(var(--min-font,0px),calc(13px * var(--ui)));color:#6d7e70}.eyebrow{font-size:max(var(--min-font,0px),calc(11px * var(--ui)));letter-spacing:.22em;font-weight:800;color:#6e8c75;margin-bottom:calc(12px * var(--ui))}.badge{display:inline-flex;align-items:center;gap:calc(7px * var(--ui));border-radius:calc(30px * var(--ui));background:#eee9d5;padding:calc(7px * var(--ui)) calc(12px * var(--ui));font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.live-dot{display:inline-block;width:calc(8px * var(--ui));height:calc(8px * var(--ui));background:#77a980;border-radius:50%;margin-right:calc(6px * var(--ui))}.offline .live-dot{background:#d79a69}.pill{border-radius:calc(50px * var(--ui))}.row{display:flex;gap:calc(12px * var(--ui));align-items:center;flex-wrap:wrap}.between{justify-content:space-between}.wide{width:100%}.muted{color:#7b887a}.divider{height:calc(1px * var(--ui));background:#e6e1ce;margin:calc(22px * var(--ui)) 0}.loading{display:grid;place-items:center;height:100dvh}canvas{display:block;outline:none;touch-action:none}.scene{position:absolute;inset:0}header{position:absolute;z-index:3;top:calc(20px * var(--ui));left:calc(24px * var(--ui));right:calc(24px * var(--ui));display:flex;align-items:center;gap:calc(14px * var(--ui));pointer-events:none}header>*{pointer-events:auto}.brand{display:flex;gap:calc(12px * var(--ui));align-items:center;background:var(--cream);padding:calc(13px * var(--ui)) calc(21px * var(--ui));border-radius:calc(19px * var(--ui));box-shadow:0 calc(5px * var(--ui)) calc(20px * var(--ui)) #3c675510}.brand b{font-size:max(var(--min-font,0px),calc(21px * var(--ui)));letter-spacing:.04em}.brand em{font-size:max(var(--min-font,0px),calc(11px * var(--ui)));display:block;font-style:normal;letter-spacing:.12em;color:#82917e;margin-top:calc(3px * var(--ui))}.brand-mark{display:grid;place-items:center;border-radius:50%;width:calc(41px * var(--ui));height:calc(41px * var(--ui));background:#dce7bf;font-size:max(var(--min-font,0px),calc(25px * var(--ui)))}.header-right{margin-left:auto;display:flex;gap:calc(10px * var(--ui));align-items:center}.coin{background:#fff1c3;padding:calc(12px * var(--ui)) calc(20px * var(--ui));border-radius:calc(40px * var(--ui));color:#88622b;box-shadow:0 calc(4px * var(--ui)) calc(15px * var(--ui)) #3c675510}.coin b{font-size:max(var(--min-font,0px),calc(24px * var(--ui)));margin-left:calc(8px * var(--ui))}.island-shell{height:100dvh;overflow:hidden;position:relative}.location{position:absolute;left:calc(25px * var(--ui));top:calc(108px * var(--ui));z-index:2;background:#fff9e8dd;backdrop-filter:blur(calc(10px * var(--ui)));border-radius:calc(14px * var(--ui));padding:calc(12px * var(--ui)) calc(16px * var(--ui));max-width:calc(300px * var(--ui))}.location strong{display:block;margin-bottom:calc(4px * var(--ui))}.location span{font-size:max(var(--min-font,0px),calc(12px * var(--ui)));color:#71826e}.side-menu{position:absolute;right:calc(24px * var(--ui));top:calc(108px * var(--ui));width:calc(245px * var(--ui));background:#fff9e9ed;backdrop-filter:blur(calc(12px * var(--ui)));border:calc(1px * var(--ui)) solid #ffffffa6;border-radius:calc(22px * var(--ui));box-shadow:0 calc(12px * var(--ui)) calc(30px * var(--ui)) #3a63551a;z-index:3;padding:calc(20px * var(--ui))}.side-menu p{font-size:max(var(--min-font,0px),calc(13px * var(--ui)));margin-bottom:calc(14px * var(--ui))}.destination{display:flex;gap:calc(10px * var(--ui));align-items:center;text-align:left;background:#f1efdf;width:100%;margin:calc(7px * var(--ui)) 0;padding:calc(10px * var(--ui)) calc(12px * var(--ui));min-height:calc(48px * var(--ui))}.destination span:first-child{font-size:max(var(--min-font,0px),calc(25px * var(--ui)))}.destination small{display:block;color:#82917b;font-weight:500;font-size:max(var(--min-font,0px),calc(11px * var(--ui)));margin-top:calc(3px * var(--ui))}.sidebar-close{float:right;background:transparent;padding:0;min-height:calc(20px * var(--ui))}.menu-button{position:absolute;right:calc(24px * var(--ui));top:calc(107px * var(--ui));z-index:2;background:var(--cream)}.goal{position:absolute;bottom:calc(26px * var(--ui));left:50%;transform:translateX(-50%);padding:calc(13px * var(--ui)) calc(20px * var(--ui));border-radius:calc(18px * var(--ui));background:#fff8e6e8;max-width:calc(390px * var(--ui));text-align:center;z-index:2;pointer-events:none;box-shadow:0 calc(5px * var(--ui)) calc(20px * var(--ui)) #3c675515}.goal strong{display:block;font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}.goal span{display:block;font-size:max(var(--min-font,0px),calc(12px * var(--ui)));color:#7c8c72;margin-top:calc(5px * var(--ui))}.crosshair{position:absolute;left:50%;top:50%;width:calc(7px * var(--ui));height:calc(7px * var(--ui));border:calc(1px * var(--ui)) solid #ffffffbd;border-radius:50%;box-shadow:0 0 0 calc(2px * var(--ui)) #304a3326;pointer-events:none}.touch-ui{position:absolute;bottom:calc(28px * var(--ui));left:calc(28px * var(--ui));width:calc(126px * var(--ui));height:calc(126px * var(--ui));border-radius:50%;border:calc(2px * var(--ui)) solid #fff8d5aa;background:#fff8df52;backdrop-filter:blur(calc(6px * var(--ui)));touch-action:none;z-index:3}.touch-ui span{position:absolute;left:calc(40px * var(--ui));top:calc(40px * var(--ui));width:calc(42px * var(--ui));height:calc(42px * var(--ui));border-radius:50%;background:#fff6decc;box-shadow:0 calc(3px * var(--ui)) calc(12px * var(--ui)) #2d5d4b26;pointer-events:none}.touch-ui:after{content:'移動';position:absolute;left:calc(44px * var(--ui));bottom:calc(-22px * var(--ui));font-size:max(var(--min-font,0px),calc(12px * var(--ui)));color:#355b4d}.actions{position:absolute;right:calc(28px * var(--ui));bottom:calc(30px * var(--ui));display:flex;gap:calc(10px * var(--ui));z-index:3;align-items:end}.interact{border-radius:50%;width:calc(90px * var(--ui));height:calc(90px * var(--ui));background:#fff1c1;border:calc(5px * var(--ui)) solid #ffffff80;box-shadow:0 calc(3px * var(--ui)) calc(20px * var(--ui)) #5c66411c}.action-stack{display:grid;gap:calc(8px * var(--ui))}.action-stack button{background:#fff9e9e8}.travel-note{position:absolute;top:48%;left:50%;transform:translate(-50%,-50%);background:var(--cream);padding:calc(17px * var(--ui)) calc(28px * var(--ui));border-radius:calc(22px * var(--ui));z-index:4;box-shadow:0 calc(10px * var(--ui)) calc(30px * var(--ui)) #335b4933;pointer-events:none}.login{min-height:100dvh;display:grid;grid-template-columns:1.3fr 1fr;background:#f4f0df}.login-art{position:relative;min-height:calc(560px * var(--ui));background:#b5d7cd;overflow:hidden}.login-art .scene{inset:0}.login-title{position:absolute;left:calc(45px * var(--ui));top:calc(45px * var(--ui));z-index:2}.login-title p{color:#3e6e5c}.postcard{position:absolute;left:calc(45px * var(--ui));bottom:calc(42px * var(--ui));font-size:max(var(--min-font,0px),calc(14px * var(--ui)));letter-spacing:.08em;padding:calc(10px * var(--ui)) calc(18px * var(--ui));background:#fff8e8c9;border-radius:calc(40px * var(--ui))}.login-form{padding:calc(50px * var(--ui)) clamp(calc(28px * var(--ui)),5vw,calc(90px * var(--ui)));display:flex;justify-content:center;flex-direction:column}.login-form>div{max-width:calc(370px * var(--ui));width:100%;margin:0 auto}.login-form h2{font-size:max(var(--min-font,0px),calc(32px * var(--ui)))}.login-form .primary{margin-top:calc(15px * var(--ui))}.error{color:#a45e43;line-height:1.6;margin:calc(12px * var(--ui)) 0;min-height:calc(22px * var(--ui))}.note{background:#e9edda;border-radius:calc(14px * var(--ui));padding:calc(15px * var(--ui));font-size:max(var(--min-font,0px),calc(13px * var(--ui)));line-height:1.8;color:#687d67}.customizer{min-height:100dvh;background:#f4f0df;display:grid;grid-template-columns:1fr 1fr}.avatar-preview{min-height:calc(600px * var(--ui));position:relative;background:radial-gradient(circle at 50% 40%,#e3e9c9,#b4cdb8)}.avatar-preview .scene{inset:10% 10% 20%}.avatar-preview h1{position:absolute;top:calc(35px * var(--ui));left:calc(35px * var(--ui));font-size:max(var(--min-font,0px),calc(27px * var(--ui)));z-index:2}.avatar-preview .badge{position:absolute;bottom:10%;left:50%;transform:translateX(-50%);background:#fff9e8}.custom-form{padding:calc(40px * var(--ui));max-width:calc(650px * var(--ui));max-height:100dvh;overflow:auto}.fields{display:grid;grid-template-columns:1fr 1fr;gap:0 calc(20px * var(--ui))}.check{display:flex;gap:calc(10px * var(--ui));align-items:start;line-height:1.7;background:#ebe6d4;border-radius:calc(12px * var(--ui));padding:calc(14px * var(--ui));font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}.check input{width:auto;margin-top:calc(5px * var(--ui))}.board-shell{height:100dvh;position:relative;overflow:hidden;background:#bad8d0}.board-sidebar{position:absolute;right:calc(24px * var(--ui));top:calc(110px * var(--ui));width:calc(285px * var(--ui));border-radius:calc(22px * var(--ui));background:#fff9e9ed;backdrop-filter:blur(calc(12px * var(--ui)));padding:calc(23px * var(--ui));max-height:calc(100dvh - calc(135px * var(--ui)));overflow:auto;z-index:3}.board-person{padding:calc(13px * var(--ui)) 0;border-bottom:calc(1px * var(--ui)) solid #e7e2d0;display:flex;gap:calc(11px * var(--ui));align-items:center}.avatar-dot{width:calc(35px * var(--ui));height:calc(35px * var(--ui));border-radius:50%;display:grid;place-items:center;color:#fff9e9;font-size:max(var(--min-font,0px),calc(15px * var(--ui)));flex-shrink:0}.board-person b{font-size:max(var(--min-font,0px),calc(15px * var(--ui)))}.board-person small{display:block;color:#7b8a78;font-size:max(var(--min-font,0px),calc(11px * var(--ui)));margin-top:calc(4px * var(--ui))}.board-person .balance{margin-left:auto;font-size:max(var(--min-font,0px),calc(15px * var(--ui)));color:#9b783e;white-space:nowrap}.board-caption{position:absolute;bottom:calc(26px * var(--ui));left:calc(25px * var(--ui));max-width:calc(420px * var(--ui));border-radius:calc(18px * var(--ui));background:#fff9e8df;padding:calc(17px * var(--ui)) calc(20px * var(--ui));font-size:max(var(--min-font,0px),calc(13px * var(--ui)));line-height:1.7}.board-caption b{display:block;font-size:max(var(--min-font,0px),calc(18px * var(--ui)));margin-bottom:calc(6px * var(--ui))}.board-stats{position:absolute;left:calc(25px * var(--ui));top:calc(115px * var(--ui));display:flex;gap:calc(12px * var(--ui));z-index:2}.stat{background:#fff9e9dd;border-radius:calc(16px * var(--ui));padding:calc(15px * var(--ui)) calc(20px * var(--ui));font-size:max(var(--min-font,0px),calc(12px * var(--ui)))}.stat b{display:block;font-size:max(var(--min-font,0px),calc(26px * var(--ui)));margin-bottom:calc(4px * var(--ui))}.board-time{background:#fff9e9;padding:calc(12px * var(--ui)) calc(17px * var(--ui));border-radius:calc(18px * var(--ui));text-align:right;font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}.board-time span{display:block;font-size:max(var(--min-font,0px),calc(11px * var(--ui)));color:#86947e;margin-top:calc(4px * var(--ui))}dialog{padding:0;border:calc(1px * var(--ui)) solid #fff9eb;border-radius:calc(25px * var(--ui));box-shadow:0 calc(25px * var(--ui)) calc(90px * var(--ui)) #183f3d55;max-width:calc(650px * var(--ui));width:calc(100% - calc(36px * var(--ui)));max-height:88dvh;background:var(--cream);color:var(--ink)}dialog::backdrop{background:#244a4166;backdrop-filter:blur(calc(5px * var(--ui)))}#panelBody{padding:calc(30px * var(--ui));overflow:auto;max-height:87dvh}.panel-header{display:flex;align-items:center;justify-content:space-between;gap:calc(15px * var(--ui));margin-bottom:calc(20px * var(--ui))}.panel-header h2{margin-bottom:0}.close{border-radius:50%;width:calc(42px * var(--ui));height:calc(42px * var(--ui));min-height:calc(42px * var(--ui));padding:0;font-size:max(var(--min-font,0px),calc(24px * var(--ui)));background:#ebe9da}.tabs{display:flex;gap:calc(8px * var(--ui));flex-wrap:wrap;margin-bottom:calc(20px * var(--ui))}.tabs button{padding:calc(9px * var(--ui)) calc(14px * var(--ui));min-height:calc(40px * var(--ui))}.tabs .selected{background:#386553;color:#fff8e5}.cards{display:grid;grid-template-columns:1fr 1fr;gap:calc(12px * var(--ui))}.card{border:calc(1px * var(--ui)) solid #e3dfca;border-radius:calc(17px * var(--ui));padding:calc(17px * var(--ui));background:#f9f5e7}.card .icon{font-size:max(var(--min-font,0px),calc(30px * var(--ui)));margin-bottom:calc(12px * var(--ui))}.card h3{font-size:max(var(--min-font,0px),calc(17px * var(--ui)))}.card p{font-size:max(var(--min-font,0px),calc(13px * var(--ui)));margin-bottom:calc(12px * var(--ui))}.card button{padding:calc(9px * var(--ui)) calc(12px * var(--ui));font-size:max(var(--min-font,0px),calc(13px * var(--ui)));min-height:calc(40px * var(--ui))}.card .row{gap:calc(7px * var(--ui))}.inventory-count{display:inline-block;font-size:max(var(--min-font,0px),calc(12px * var(--ui)));color:#809078;margin-left:calc(6px * var(--ui))}.price{color:#98723b;font-weight:bold}.journey{display:flex;justify-content:space-between;gap:calc(10px * var(--ui));margin:calc(24px * var(--ui)) 0 calc(12px * var(--ui))}.journey span{border-radius:calc(12px * var(--ui));padding:calc(13px * var(--ui)) calc(8px * var(--ui));text-align:center;background:#ebe8d6;flex:1;font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.journey .done{background:#d7e7bd}.journey .current{background:#ffe5a3}.question{font-size:max(var(--min-font,0px),calc(23px * var(--ui)));line-height:1.65;margin:calc(23px * var(--ui)) 0}.choices{display:grid;gap:calc(10px * var(--ui))}.choices button{text-align:left;background:#f0eddc;display:flex;gap:calc(15px * var(--ui));align-items:center}.choices button span{display:grid;place-items:center;border-radius:50%;width:calc(30px * var(--ui));height:calc(30px * var(--ui));background:#fff9e9;font-size:max(var(--min-font,0px),calc(13px * var(--ui)));flex-shrink:0}.choices .wrong{background:#f1d8bd}.choices .correct{background:#d8e7b9}.feedback{padding:calc(15px * var(--ui));border-radius:calc(14px * var(--ui));margin-top:calc(18px * var(--ui));background:#e6ecd6;line-height:1.8}.feedback:empty{display:none}.activity-art{text-align:center;font-size:max(var(--min-font,0px),calc(55px * var(--ui)));height:calc(95px * var(--ui));background:#e4edda;border-radius:calc(17px * var(--ui));display:grid;place-items:center}.activity-art span{animation:bob 2.5s ease-in-out infinite}.reward{text-align:center;padding:calc(15px * var(--ui))}.reward .big{font-size:max(var(--min-font,0px),calc(65px * var(--ui)));margin:calc(15px * var(--ui))}.reward strong{display:block;font-size:max(var(--min-font,0px),calc(37px * var(--ui)));color:#a0803e;margin:calc(15px * var(--ui))}.placement-note{position:absolute;top:calc(200px * var(--ui));left:calc(25px * var(--ui));max-width:calc(270px * var(--ui));background:#fff3c9;padding:calc(15px * var(--ui));border-radius:calc(15px * var(--ui));z-index:4;line-height:1.7;font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}#toast{position:fixed;left:50%;bottom:calc(24px * var(--ui));transform:translateX(-50%);background:#254f46;color:#fff7dd;padding:calc(13px * var(--ui)) calc(23px * var(--ui));border-radius:calc(14px * var(--ui));z-index:20;box-shadow:0 calc(4px * var(--ui)) calc(15px * var(--ui)) #1b493633;max-width:85%;display:none;line-height:1.6}#toast.show{display:block}.hidden{display:none!important}.travel-screen{padding:calc(25px * var(--ui));text-align:center}.travel-screen .boat{font-size:max(var(--min-font,0px),calc(70px * var(--ui)));animation:sail 1.7s ease-in-out infinite}.ledger{font-size:max(var(--min-font,0px),calc(12px * var(--ui)));line-height:1.8;color:#798771}.instructions li{margin:calc(10px * var(--ui)) 0;line-height:1.7}a{color:#386d59}@keyframes bob{50%{transform:translateY(calc(-6px * var(--ui))) rotate(-3deg)}}@keyframes sail{50%{transform:translateX(calc(20px * var(--ui))) rotate(5deg)}}@media(max-width:1000px){.brand{padding:calc(11px * var(--ui)) calc(14px * var(--ui))}.brand b{font-size:max(var(--min-font,0px),calc(18px * var(--ui)))}.brand em{font-size:max(var(--min-font,0px),calc(9px * var(--ui)))}header{left:calc(16px * var(--ui));right:calc(16px * var(--ui));top:calc(14px * var(--ui));gap:calc(8px * var(--ui))}.header-right{gap:calc(6px * var(--ui))}.coin{padding:calc(10px * var(--ui)) calc(13px * var(--ui))}.coin b{font-size:max(var(--min-font,0px),calc(21px * var(--ui)))}.side-menu{right:calc(16px * var(--ui));width:calc(225px * var(--ui));top:calc(92px * var(--ui))}.location{left:calc(16px * var(--ui));top:calc(92px * var(--ui))}.menu-button{right:calc(16px * var(--ui));top:calc(92px * var(--ui))}.goal{bottom:calc(23px * var(--ui));max-width:calc(250px * var(--ui))}.board-sidebar{width:calc(245px * var(--ui))}.board-stats{top:calc(100px * var(--ui))}.login{grid-template-columns:1fr 1fr}.login-title{left:calc(25px * var(--ui));top:calc(30px * var(--ui))}.login-title h1{font-size:max(var(--min-font,0px),calc(34px * var(--ui)))}.custom-form{padding:calc(30px * var(--ui))}.avatar-preview .scene{inset:15% 0 15%}.touch-ui{bottom:calc(35px * var(--ui));left:calc(22px * var(--ui));width:calc(115px * var(--ui));height:calc(115px * var(--ui))}.touch-ui span{left:calc(35px * var(--ui));top:calc(35px * var(--ui))}.touch-ui:after{left:calc(39px * var(--ui))}.actions{right:calc(20px * var(--ui))}.interact{width:calc(80px * var(--ui));height:calc(80px * var(--ui))}.goal{display:none}}@media(max-width:650px){.login{display:block}.login-art{min-height:calc(280px * var(--ui));height:37dvh}.login-form{padding:calc(27px * var(--ui))}.login-title{top:calc(23px * var(--ui))}.login-title h1{font-size:max(var(--min-font,0px),calc(32px * var(--ui)))}.login-title p{font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.postcard{display:none}.customizer{display:block}.avatar-preview{min-height:calc(320px * var(--ui));height:40dvh}.avatar-preview h1{font-size:max(var(--min-font,0px),calc(21px * var(--ui)));top:calc(20px * var(--ui));left:calc(20px * var(--ui))}.avatar-preview .scene{inset:15% 10% 7%}.avatar-preview .badge{bottom:5%}.custom-form{padding:calc(24px * var(--ui));max-height:none}.fields{gap:0 calc(12px * var(--ui))}.brand-mark{width:calc(32px * var(--ui));height:calc(32px * var(--ui));font-size:max(var(--min-font,0px),calc(20px * var(--ui)))}.brand{gap:calc(7px * var(--ui));border-radius:calc(14px * var(--ui));padding:calc(10px * var(--ui)) calc(11px * var(--ui))}.brand b{font-size:max(var(--min-font,0px),calc(16px * var(--ui)))}.brand em{display:none}.header-right .logout{display:none}.coin{font-size:max(var(--min-font,0px),calc(11px * var(--ui)));padding:calc(10px * var(--ui))}.coin b{font-size:max(var(--min-font,0px),calc(18px * var(--ui)))}.location{max-width:calc(215px * var(--ui));top:calc(80px * var(--ui));padding:calc(10px * var(--ui)) calc(12px * var(--ui))}.location span{font-size:max(var(--min-font,0px),calc(10px * var(--ui)))}.location strong{font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.menu-button{top:calc(80px * var(--ui));min-height:calc(44px * var(--ui));font-size:max(var(--min-font,0px),calc(12px * var(--ui)));padding:calc(10px * var(--ui))}.side-menu{top:calc(80px * var(--ui));width:calc(225px * var(--ui));padding:calc(17px * var(--ui))}.touch-ui{left:calc(18px * var(--ui));bottom:calc(40px * var(--ui));width:calc(106px * var(--ui));height:calc(106px * var(--ui))}.touch-ui span{left:calc(30px * var(--ui));top:calc(30px * var(--ui))}.touch-ui:after{left:calc(34px * var(--ui))}.actions{right:calc(15px * var(--ui));bottom:calc(26px * var(--ui));gap:calc(7px * var(--ui))}.interact{width:calc(74px * var(--ui));height:calc(74px * var(--ui));font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}.action-stack button{font-size:max(var(--min-font,0px),calc(12px * var(--ui)));min-height:calc(40px * var(--ui));padding:calc(10px * var(--ui))}.cards{gap:calc(9px * var(--ui))}.card{padding:calc(13px * var(--ui))}.card h3{font-size:max(var(--min-font,0px),calc(15px * var(--ui)))}#panelBody{padding:calc(23px * var(--ui))}.question{font-size:max(var(--min-font,0px),calc(20px * var(--ui)))}.board-sidebar{width:calc(205px * var(--ui));right:calc(12px * var(--ui));top:calc(90px * var(--ui));padding:calc(17px * var(--ui))}.board-stats{left:calc(14px * var(--ui));top:calc(90px * var(--ui));flex-direction:column;gap:calc(7px * var(--ui))}.stat{padding:calc(10px * var(--ui)) calc(14px * var(--ui))}.stat b{font-size:max(var(--min-font,0px),calc(22px * var(--ui)))}.board-person b{font-size:max(var(--min-font,0px),calc(12px * var(--ui)))}.board-person .balance{font-size:max(var(--min-font,0px),calc(12px * var(--ui)))}.board-caption{left:calc(14px * var(--ui));bottom:calc(15px * var(--ui));max-width:calc(200px * var(--ui));font-size:max(var(--min-font,0px),calc(11px * var(--ui)))}.board-caption b{font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}.board-time{font-size:max(var(--min-font,0px),calc(12px * var(--ui)));padding:calc(10px * var(--ui))}.board-time span{display:none}.placement-note{top:calc(155px * var(--ui));left:calc(16px * var(--ui));max-width:calc(215px * var(--ui))}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

.interact{padding:0;line-height:1.5}


.board-person{padding:calc(8px * var(--ui)) 0}.board-sidebar{padding:calc(20px * var(--ui))}.board-person small{line-height:1.25}

.camera-controls{position:absolute;right:calc(24px * var(--ui));top:50%;transform:translateY(-50%);display:grid;gap:calc(8px * var(--ui));justify-items:end;z-index:2}.camera-controls button{width:calc(52px * var(--ui));height:calc(52px * var(--ui));min-height:calc(52px * var(--ui));padding:0;border-radius:50%;background:#fff9e9e8;font-size:max(var(--min-font,0px),calc(22px * var(--ui)));box-shadow:0 calc(4px * var(--ui)) calc(14px * var(--ui)) #3c675518}.camera-controls .cam-label{width:auto;border-radius:calc(26px * var(--ui));padding:0 calc(14px * var(--ui));font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.board-shell .camera-controls{left:calc(25px * var(--ui));right:auto;justify-items:start}@media(max-width:650px){.camera-controls{right:calc(14px * var(--ui));gap:calc(6px * var(--ui))}.camera-controls button{width:calc(44px * var(--ui));height:calc(44px * var(--ui));min-height:calc(44px * var(--ui));font-size:max(var(--min-font,0px),calc(19px * var(--ui)))}.camera-controls .cam-label{font-size:max(var(--min-font,0px),calc(11px * var(--ui)));padding:0 calc(10px * var(--ui))}.board-shell .camera-controls{left:calc(14px * var(--ui));top:auto;bottom:calc(120px * var(--ui));transform:none}}
.speech{background:#fff3cf;border-radius:calc(18px * var(--ui));padding:calc(16px * var(--ui)) calc(18px * var(--ui));font-size:max(var(--min-font,0px),calc(17px * var(--ui)));line-height:1.7;position:relative;margin-top:calc(6px * var(--ui))}.speech:before{content:"";position:absolute;left:calc(28px * var(--ui));top:calc(-9px * var(--ui));border:calc(9px * var(--ui)) solid transparent;border-top:0;border-bottom-color:#fff3cf}

.nickname-hint{margin:0 0 calc(18px * var(--ui))}.nickname-editor{margin-top:calc(20px * var(--ui));padding-top:calc(16px * var(--ui));border-top:calc(1px * var(--ui)) solid #e3dfca}.nickname-editor .small{margin-bottom:calc(8px * var(--ui))}.real-name{margin-top:calc(20px * var(--ui))}.avatar-preview h1{max-width:calc(100% - calc(70px * var(--ui)));overflow-wrap:anywhere}

/* V2: keep the island visible beside the activity controls. */
.goal{pointer-events:auto;display:block;text-align:left;max-width:calc(440px * var(--ui));line-height:1.5}
.activity-panel{position:absolute;right:calc(20px * var(--ui));top:calc(170px * var(--ui));width:calc(300px * var(--ui));max-height:calc(100dvh - calc(325px * var(--ui)));overflow:auto;z-index:5;background:var(--cream);border:calc(1px * var(--ui)) solid #fff;border-radius:calc(22px * var(--ui));padding:calc(18px * var(--ui));box-shadow:0 calc(8px * var(--ui)) calc(35px * var(--ui)) #244a4133;overscroll-behavior:contain}
.activity-panel h3{margin:0}.activity-panel p{margin:calc(10px * var(--ui)) 0;font-size:max(var(--min-font,0px),calc(14px * var(--ui)));color:var(--ink)}.activity-panel button{margin-top:calc(8px * var(--ui));min-height:calc(48px * var(--ui))}.activity-panel .row button{margin:0;padding:0;width:calc(44px * var(--ui));min-height:calc(44px * var(--ui))}.activity-counter{font-weight:800;font-size:max(var(--min-font,0px),calc(18px * var(--ui)))!important}.activity-panel progress{width:100%;height:calc(10px * var(--ui));accent-color:var(--green)}
.has-activity .camera-controls{right:calc(340px * var(--ui))}.side-menu{max-height:calc(100dvh - calc(125px * var(--ui)));overflow:auto;z-index:6}.goal-list{padding-left:0;list-style:none}.goal-list li{padding:calc(14px * var(--ui)) 0;border-bottom:calc(1px * var(--ui)) solid #e3dfca;line-height:1.7}.goal-list b{float:right}.material-have{color:#28623d}.material-missing{color:#a34429}.card ul{padding-left:calc(18px * var(--ui));line-height:1.9}.ticket-notice{background:#ffe7a5;padding:calc(12px * var(--ui));border-radius:calc(12px * var(--ui));font-weight:700}.dex-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:calc(10px * var(--ui))}.dex-entry{background:#e8edda;border:calc(1px * var(--ui)) solid #d8dfc6;border-radius:calc(14px * var(--ui));padding:calc(14px * var(--ui)) calc(8px * var(--ui));display:grid;gap:calc(8px * var(--ui));text-align:center;font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}.dex-icon{font-size:max(var(--min-font,0px),calc(30px * var(--ui)))}.dex-entry.undiscovered{background:#e3e4dd;color:#606b63}.undiscovered .dex-icon{background:#6c7b72;color:#fff;border-radius:50%;width:calc(44px * var(--ui));margin:auto}.dex-group{margin:calc(25px * var(--ui)) 0}.harvest-list{padding-left:calc(20px * var(--ui));line-height:1.8}.card,.speech,.feedback,.goal{overflow-wrap:anywhere}.board-stats{flex-wrap:wrap;max-width:calc(100% - calc(340px * var(--ui)))}.stat small{display:block}.tabs button{min-height:calc(44px * var(--ui))}.card button{min-height:calc(44px * var(--ui))}
@media(min-width:651px) and (max-height:750px){.activity-panel{top:calc(145px * var(--ui));max-height:calc(100dvh - calc(265px * var(--ui)));padding:calc(14px * var(--ui))}.activity-panel p{margin:calc(6px * var(--ui)) 0}.activity-panel button{min-height:calc(44px * var(--ui));padding:calc(9px * var(--ui)) calc(12px * var(--ui))}.goal{bottom:calc(14px * var(--ui));max-width:calc(300px * var(--ui));font-size:max(var(--min-font,0px),calc(12px * var(--ui)))}}
@media(max-width:1000px){.goal{display:block;bottom:calc(18px * var(--ui));max-width:calc(290px * var(--ui));padding:calc(10px * var(--ui)) calc(12px * var(--ui))}.goal span{display:none}.activity-panel{right:calc(16px * var(--ui));width:calc(280px * var(--ui))}.has-activity .camera-controls{right:calc(310px * var(--ui))}}
@media(max-width:650px){.goal{top:calc(138px * var(--ui));bottom:auto;left:calc(16px * var(--ui));transform:none;max-width:calc(100% - calc(88px * var(--ui)));padding:calc(9px * var(--ui)) calc(12px * var(--ui))}.goal strong{font-size:max(var(--min-font,0px),calc(12px * var(--ui)))}.activity-panel{top:auto;right:calc(10px * var(--ui));left:calc(10px * var(--ui));bottom:calc(calc(10px * var(--ui)) + env(safe-area-inset-bottom));width:auto;max-height:42dvh;padding:calc(14px * var(--ui)) calc(16px * var(--ui));border-radius:calc(20px * var(--ui))}.has-activity .actions{bottom:calc(43dvh + calc(16px * var(--ui)));right:calc(10px * var(--ui))}.has-activity .touch-ui{bottom:calc(43dvh + calc(25px * var(--ui)));left:calc(16px * var(--ui))}.has-activity .camera-controls{right:calc(12px * var(--ui));top:calc(210px * var(--ui));transform:none}.has-activity .action-stack{display:none}.activity-panel .quiet{font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.activity-panel p{margin:calc(7px * var(--ui)) 0}.activity-panel .activity-counter{font-size:max(var(--min-font,0px),calc(16px * var(--ui)))!important}.dex-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.board-stats{max-width:calc(100% - calc(230px * var(--ui)))}#toast{bottom:calc(calc(16px * var(--ui)) + env(safe-area-inset-bottom));z-index:30}#toast.above-activity{bottom:46dvh}}

@media(max-width:650px){.header-right #connection{font-size:0;gap:0;padding:calc(8px * var(--ui))}.header-right #connection .live-dot{margin:0}}
@media(max-width:650px){.activity-panel{max-height:34dvh;padding:calc(10px * var(--ui)) calc(14px * var(--ui))}.activity-panel progress{display:none}.activity-panel p{margin:calc(4px * var(--ui)) 0;font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.activity-panel button{min-height:calc(42px * var(--ui));margin-top:calc(6px * var(--ui))}}

/* V3: model thumbnails, touch prompts and home tools. */
.item-icon{display:inline-grid;place-items:center;vertical-align:middle;width:calc(56px * var(--ui));height:calc(56px * var(--ui));min-width:calc(56px * var(--ui));border-radius:calc(12px * var(--ui));background:#e6eadb;overflow:hidden;margin:calc(3px * var(--ui));line-height:1}.item-icon img{width:100%;height:100%;object-fit:contain}.loading-icon:before{content:'';width:calc(25px * var(--ui));height:calc(25px * var(--ui));border-radius:calc(7px * var(--ui));background:#d1dac7}.card li .item-icon,p .item-icon{width:calc(32px * var(--ui));height:calc(32px * var(--ui));min-width:calc(32px * var(--ui))}.dex-icon .item-icon{margin:auto}.prompt-layer{position:absolute;inset:0;pointer-events:none;z-index:4}.world-prompt{min-height:56px;position:absolute;transform:translate(-50%,-110%);pointer-events:auto;min-height:calc(56px * var(--ui));min-width:calc(142px * var(--ui));box-shadow:0 calc(5px * var(--ui)) calc(20px * var(--ui)) #244a4140;border:calc(2px * var(--ui)) solid #fff6da;font-size:max(var(--min-font,0px),calc(17px * var(--ui)))}.world-prompt:active{transform:translate(-50%,-110%) scale(.96)}.edit-home{position:absolute;right:calc(24px * var(--ui));top:calc(175px * var(--ui));z-index:3;min-height:calc(56px * var(--ui));background:var(--cream)}.edit-drawer{position:absolute;right:calc(16px * var(--ui));top:calc(100px * var(--ui));bottom:calc(18px * var(--ui));width:calc(310px * var(--ui));z-index:7;border:calc(1px * var(--ui)) solid #fff7e9;background:var(--cream);border-radius:calc(22px * var(--ui));padding:calc(16px * var(--ui));overflow:auto;overscroll-behavior:contain;box-shadow:0 calc(10px * var(--ui)) calc(32px * var(--ui)) #234f4733}.edit-drawer .tabs{gap:calc(4px * var(--ui));margin:calc(12px * var(--ui)) 0}.edit-drawer .tabs button{padding:calc(8px * var(--ui)) calc(10px * var(--ui));font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.edit-drawer h3{margin:0}.catalog{display:grid;grid-template-columns:1fr 1fr;gap:calc(8px * var(--ui));margin-bottom:calc(20px * var(--ui))}.catalog-item{display:flex;align-items:center;flex-direction:column;padding:calc(9px * var(--ui));text-align:center;font-size:max(var(--min-font,0px),calc(14px * var(--ui)));gap:calc(5px * var(--ui));min-width:0}.catalog-item small{font-size:max(var(--min-font,0px),calc(12px * var(--ui)));line-height:1.5;font-weight:500}.placed-list{display:grid;gap:calc(6px * var(--ui));margin-top:calc(10px * var(--ui))}.placed-list button{text-align:left;padding:calc(8px * var(--ui));font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.placed-list .item-icon{width:calc(36px * var(--ui));height:calc(36px * var(--ui));min-width:calc(36px * var(--ui))}.edit-tools{position:absolute;left:calc(20px * var(--ui));bottom:calc(24px * var(--ui));z-index:8;max-width:calc(100% - calc(370px * var(--ui)));padding:calc(16px * var(--ui));border-radius:calc(18px * var(--ui));background:#fff9e9f5;box-shadow:0 calc(6px * var(--ui)) calc(25px * var(--ui)) #244a4133}.edit-tools p{margin:calc(5px * var(--ui)) 0 calc(10px * var(--ui));line-height:1.5}.edit-tools button{min-height:calc(48px * var(--ui));margin:calc(3px * var(--ui))}.edit-tools label{display:inline-block;width:calc(100px * var(--ui));margin:0 calc(8px * var(--ui)) calc(8px * var(--ui)) 0;font-size:max(var(--min-font,0px),calc(12px * var(--ui)))}.edit-tools input{padding:calc(8px * var(--ui))}.editing .actions,.editing .goal,.editing .menu-button,.editing .location,.editing .crosshair{display:none!important}.editing .camera-controls{right:calc(345px * var(--ui))}.editing .activity-panel{display:none}.transition-shield{position:absolute;inset:0;background:#244a411a;display:grid;place-items:center;z-index:15;pointer-events:auto;color:var(--ink);font-size:max(var(--min-font,0px),calc(18px * var(--ui)));font-weight:bold}.farm-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:calc(10px * var(--ui))}.farm-grid button{display:grid;justify-items:center;gap:calc(8px * var(--ui));min-height:calc(120px * var(--ui));padding:calc(12px * var(--ui)) calc(5px * var(--ui));font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}.farm-grid span{font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.farm-grid .item-icon{font-size:inherit}#buildProgress{width:100%;height:calc(22px * var(--ui));accent-color:var(--green)}#buildRemaining{font-size:max(var(--min-font,0px),calc(26px * var(--ui)));font-weight:700;font-variant-numeric:tabular-nums}.hud-flight{position:fixed;z-index:50;pointer-events:none;font-size:max(var(--min-font,0px),calc(28px * var(--ui)));width:calc(46px * var(--ui));height:calc(46px * var(--ui))}.hud-flight .item-icon{width:calc(46px * var(--ui));height:calc(46px * var(--ui));min-width:calc(46px * var(--ui))}.celebration-banner{position:fixed;top:calc(28px * var(--ui));left:50%;transform:translateX(-50%);z-index:40;padding:calc(18px * var(--ui)) calc(32px * var(--ui));border-radius:calc(20px * var(--ui));background:#fff0b8;border:calc(2px * var(--ui)) solid #e1bd67;box-shadow:0 calc(10px * var(--ui)) calc(36px * var(--ui)) #244a4133;font-size:max(var(--min-font,0px),calc(24px * var(--ui)));font-weight:800;animation:banner-in .35s ease-out;pointer-events:none}.title-badge{top:calc(110px * var(--ui));background:#e6edce;font-size:max(var(--min-font,0px),calc(21px * var(--ui)));animation:badge-in .45s ease-out}.coin-notice{top:calc(90px * var(--ui));font-size:max(var(--min-font,0px),calc(20px * var(--ui)));padding:calc(10px * var(--ui)) calc(18px * var(--ui))}.quest-stamped{position:relative}.quest-stamped:after{content:'完成！';position:absolute;right:calc(15px * var(--ui));top:calc(18px * var(--ui));color:#a54b34;border:calc(3px * var(--ui)) solid currentColor;border-radius:calc(7px * var(--ui));padding:calc(8px * var(--ui));transform:rotate(-12deg);animation:badge-in .2s ease-out}.donation-glow{position:fixed;left:50%;top:40%;z-index:45;display:grid;justify-items:center;background:#fff6cc;padding:calc(24px * var(--ui));border-radius:calc(25px * var(--ui));box-shadow:0 0 calc(70px * var(--ui)) #ffe49b;animation:donate-in 1.8s both;pointer-events:none}.craft-stage{text-align:center;overflow:hidden;min-height:calc(220px * var(--ui))}.craft-materials{animation:materials-in .8s both}.craft-hammer{font-size:max(var(--min-font,0px),calc(55px * var(--ui)));animation:hammer .3s 3}.craft-result{text-align:center;animation:badge-in .3s ease-out}.craft-result .item-icon{width:calc(128px * var(--ui));height:calc(128px * var(--ui))}.harvest-icon{display:inline-block;animation:badge-in .3s ease-out}dialog[open]{animation:dialog-in .15s ease-out}.side-menu:not(.hidden),.activity-panel:not(.hidden),.edit-drawer:not(.hidden){animation:panel-in .15s ease-out}.card .item-icon{flex-shrink:0}.edit-tools:focus-within{z-index:9}
@keyframes dialog-in{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:scale(1)}}@keyframes panel-in{from{opacity:0;translate:calc(18px * var(--ui)) 0}to{opacity:1;translate:0 0}}@keyframes banner-in{from{opacity:0;translate:0 calc(-70px * var(--ui))}to{opacity:1;translate:0 0}}@keyframes badge-in{from{opacity:0;scale:1.4}to{opacity:1;scale:1}}@keyframes materials-in{to{opacity:0;transform:translateY(calc(75px * var(--ui))) scale(.3)}}@keyframes hammer{50%{transform:rotate(-35deg)}}@keyframes donate-in{0%{opacity:0;transform:translate(-50%,calc(35px * var(--ui))) scale(.6)}25%,65%{opacity:1;transform:translate(-50%,0) scale(1)}100%{opacity:0;transform:translate(-50%,calc(-70px * var(--ui))) scale(.6)}}
@media(max-width:1000px){.edit-home{right:calc(16px * var(--ui));top:calc(155px * var(--ui))}.edit-drawer{top:calc(92px * var(--ui));width:calc(290px * var(--ui))}.editing .camera-controls{right:calc(322px * var(--ui))}.edit-tools{max-width:calc(100% - calc(340px * var(--ui)))}}
@media(max-width:650px){.edit-home{right:calc(14px * var(--ui));top:calc(140px * var(--ui));font-size:max(var(--min-font,0px),calc(14px * var(--ui)));padding:calc(10px * var(--ui))}.edit-drawer{left:calc(8px * var(--ui));right:calc(8px * var(--ui));bottom:calc(calc(8px * var(--ui)) + env(safe-area-inset-bottom));top:auto;width:auto;max-height:35dvh;padding:calc(12px * var(--ui))}.edit-tools{left:calc(8px * var(--ui));right:calc(8px * var(--ui));bottom:calc(36dvh + calc(14px * var(--ui)));max-width:none;padding:calc(10px * var(--ui));font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.edit-tools p{margin:calc(4px * var(--ui)) 0}.edit-tools button{padding:calc(10px * var(--ui));min-height:calc(44px * var(--ui))}.edit-tools label{width:calc(75px * var(--ui))}.catalog{grid-template-columns:repeat(3,minmax(0,1fr))}.catalog-item{font-size:max(var(--min-font,0px),calc(12px * var(--ui)))}.editing .camera-controls{right:calc(12px * var(--ui));top:calc(155px * var(--ui));transform:none}.celebration-banner{font-size:max(var(--min-font,0px),calc(18px * var(--ui)));width:85%;text-align:center;padding:calc(16px * var(--ui))}.farm-grid{gap:calc(6px * var(--ui))}.farm-grid button{font-size:max(var(--min-font,0px),calc(12px * var(--ui)))}.farm-grid .item-icon{width:calc(42px * var(--ui));height:calc(42px * var(--ui));min-width:calc(42px * var(--ui))}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.hud-flight{display:none}}
.skip-trip{position:absolute;right:calc(24px * var(--ui));bottom:calc(28px * var(--ui));min-height:calc(56px * var(--ui));padding:0 calc(22px * var(--ui));border-radius:calc(28px * var(--ui));background:var(--cream);font-size:max(var(--min-font,0px),calc(17px * var(--ui)));box-shadow:0 calc(6px * var(--ui)) calc(20px * var(--ui)) #244a4133}

/* V4: touch-friendly collections, gift counters and visiting. */
[hidden]{display:none!important}
.item-collection{min-width:0}.collection-controls{margin:calc(12px * var(--ui)) 0 calc(18px * var(--ui))}.collection-controls .tabs{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior:contain;scrollbar-width:thin;gap:calc(8px * var(--ui));padding:calc(3px * var(--ui)) calc(2px * var(--ui)) calc(8px * var(--ui));margin:0 0 calc(8px * var(--ui))}.collection-controls .tabs button{flex:0 0 auto;min-height:calc(44px * var(--ui));font-size:max(var(--min-font,0px),calc(14px * var(--ui)));white-space:nowrap}.sub-tabs button{background:#e7ead8}.sub-tabs .selected{background:#386553;color:#fff8e5}.item-search{display:block;margin-bottom:calc(12px * var(--ui));font-size:max(var(--min-font,0px),calc(15px * var(--ui)))}.item-search input{margin-top:calc(6px * var(--ui));min-height:calc(46px * var(--ui));font-size:max(var(--min-font,0px),calc(16px * var(--ui)))}.collection-entry{min-width:0}.collection-entry>.card{height:100%}.filter-empty{padding:calc(18px * var(--ui));background:#e7ead8;border-radius:calc(14px * var(--ui))}.gift-choice{width:100%;display:grid;justify-items:center;gap:calc(8px * var(--ui));text-align:center}.gift-choice span{font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}.gift-badge{display:inline-grid;place-items:center;min-width:calc(24px * var(--ui));height:calc(24px * var(--ui));padding:0 calc(5px * var(--ui));margin-left:calc(6px * var(--ui));border-radius:calc(14px * var(--ui));background:#9a412d;color:#fff;font-weight:800;font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.gift-notice{top:calc(165px * var(--ui));font-size:max(var(--min-font,0px),calc(19px * var(--ui)))}.boat-options{display:grid;gap:calc(12px * var(--ui));margin:calc(20px * var(--ui)) 0}.choices small{display:block;margin-top:calc(6px * var(--ui));font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}.dex-title{background:#e5ebd2;padding:calc(14px * var(--ui));border-radius:calc(14px * var(--ui));line-height:1.7}.edit-drawer .item-search{font-size:max(var(--min-font,0px),calc(14px * var(--ui)))}.edit-drawer .item-search input{padding:calc(10px * var(--ui))}.edit-drawer .collection-controls{margin:calc(8px * var(--ui)) 0}.item-collection .card h3{line-height:1.5}button:focus-visible,input:focus-visible{outline:calc(3px * var(--ui)) solid #947033;outline-offset:calc(3px * var(--ui))}.board-stats{gap:calc(8px * var(--ui))}.board-stats .stat{padding:calc(12px * var(--ui)) calc(16px * var(--ui))}.board-stats .stat b{font-size:max(var(--min-font,0px),calc(25px * var(--ui)))}
@media(max-width:800px){.location{max-width:calc(100% - calc(230px * var(--ui)))}.location strong{overflow-wrap:anywhere}.edit-drawer{width:calc(300px * var(--ui))}.item-collection .cards{grid-template-columns:repeat(2,minmax(0,1fr))}.collection-controls .tabs button{padding:calc(10px * var(--ui)) calc(14px * var(--ui))}.gift-notice{width:85%;top:calc(165px * var(--ui))}.board-stats .stat{padding:calc(8px * var(--ui)) calc(12px * var(--ui))}.board-stats .stat b{font-size:max(var(--min-font,0px),calc(21px * var(--ui)))}}
@media(max-width:650px){.edit-drawer{width:auto}.item-collection .card{padding:calc(12px * var(--ui))}.location{max-width:calc(100% - calc(155px * var(--ui)))}}
.gift-wrapped{font-size:max(var(--min-font,0px),calc(34px * var(--ui)));background:#fde6e6}

/* V5: social controls and the teacher's island view. */
.teacher-shell .location,.teacher-customizer .badge{background:#fff0b8;border:calc(1px * var(--ui)) solid #d7b057;color:#624819}
.teacher-shell .action-stack button{min-height:calc(48px * var(--ui))}.teacher-shell .action-stack{max-width:calc(220px * var(--ui))}
.emote-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:calc(10px * var(--ui));margin:calc(18px * var(--ui)) 0}
.emote-grid button,.interaction-choices button,.phrase-choices button{min-height:calc(48px * var(--ui))}
.phrase-choices{margin:calc(16px * var(--ui)) 0}.interaction-choices button{display:block}
.emote-grid button:disabled,.phrase-choices button:disabled,.interaction-choices button:disabled{opacity:.45;cursor:wait}
.online-people{border-top:calc(1px * var(--ui)) solid #d1d9bf;margin-top:calc(18px * var(--ui));padding-top:calc(14px * var(--ui));line-height:1.8}
.online-people h3{margin-bottom:calc(8px * var(--ui))}.online-name{display:inline;min-height:calc(44px * var(--ui));padding:calc(5px * var(--ui)) calc(3px * var(--ui));background:transparent;text-decoration:underline;text-underline-offset:calc(4px * var(--ui));font-size:max(var(--min-font,0px),calc(15px * var(--ui)));overflow-wrap:anywhere}
.teacher-announce{position:absolute;top:calc(150px * var(--ui));left:50%;transform:translateX(-50%);z-index:12;width:min(calc(680px * var(--ui)),calc(100% - calc(48px * var(--ui))));display:flex;align-items:center;justify-content:space-between;gap:calc(16px * var(--ui));padding:calc(16px * var(--ui)) calc(20px * var(--ui));background:#fff0b8;color:#624819;border:calc(2px * var(--ui)) solid #c39b40;border-radius:calc(18px * var(--ui));box-shadow:0 calc(6px * var(--ui)) calc(25px * var(--ui)) #5c4d2526;line-height:1.6}
.teacher-announce div{display:grid;gap:calc(4px * var(--ui));min-width:0}.teacher-announce span{overflow-wrap:anywhere;font-size:max(var(--min-font,0px),calc(20px * var(--ui)));font-weight:700}.teacher-announce button{flex-shrink:0;min-height:calc(48px * var(--ui))}
.gift-action-notice{top:calc(285px * var(--ui));pointer-events:auto;display:flex;align-items:center;gap:calc(14px * var(--ui));font-size:max(var(--min-font,0px),calc(17px * var(--ui)));max-width:calc(100% - calc(32px * var(--ui)));line-height:1.6}.gift-action-notice button{min-height:calc(44px * var(--ui));flex-shrink:0}
.trip-caption{position:absolute;top:calc(calc(24px * var(--ui)) + env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:16;max-width:calc(100% - calc(48px * var(--ui)));padding:calc(12px * var(--ui)) calc(22px * var(--ui));border-radius:calc(24px * var(--ui));background:#fff9e9f5;color:#254f46;font-weight:700;text-align:center;line-height:1.6;pointer-events:none;box-shadow:0 calc(4px * var(--ui)) calc(16px * var(--ui)) #244a4126}
.teacher-person{border-bottom:calc(1px * var(--ui)) solid #d7b057}.teacher-dot{background:#e8bc48!important;border:calc(2px * var(--ui)) solid #fff4c7;flex-shrink:0}.teacher-person button{font-size:max(var(--min-font,0px),calc(12px * var(--ui)));padding:calc(8px * var(--ui));min-height:calc(44px * var(--ui))}
#announceForm{margin-top:calc(22px * var(--ui))}#announceText{display:block;width:100%;min-height:calc(90px * var(--ui));margin-top:calc(8px * var(--ui));padding:calc(12px * var(--ui));border:calc(1px * var(--ui)) solid #b9c5aa;border-radius:calc(12px * var(--ui));font:inherit;color:var(--ink);background:#fffdf4;resize:vertical}
textarea:focus-visible,select:focus-visible{outline:calc(3px * var(--ui)) solid #947033;outline-offset:calc(3px * var(--ui))}
@media(max-width:800px){.teacher-announce{top:calc(150px * var(--ui));width:calc(100% - calc(32px * var(--ui)));padding:calc(12px * var(--ui)) calc(16px * var(--ui))}.teacher-announce span{font-size:max(var(--min-font,0px),calc(18px * var(--ui)))}.teacher-shell .action-stack{max-width:calc(200px * var(--ui))}.board-shell .board-time{display:none}}
@media(max-width:650px){.emote-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.teacher-announce{top:calc(145px * var(--ui));gap:calc(8px * var(--ui));align-items:stretch;flex-direction:column}.teacher-announce button{min-height:calc(44px * var(--ui));padding:calc(10px * var(--ui))}.teacher-shell .actions{gap:calc(8px * var(--ui))}.teacher-shell .action-stack{max-width:calc(190px * var(--ui))}.teacher-shell .action-stack button{min-height:calc(44px * var(--ui));font-size:max(var(--min-font,0px),calc(13px * var(--ui)))}.trip-caption{top:calc(16px * var(--ui));font-size:max(var(--min-font,0px),calc(14px * var(--ui)));padding:calc(10px * var(--ui)) calc(16px * var(--ui))}}

/* V5 mobile: short-edge scaling; the desktop/tablet layout retains its tokens. */
.mobile-more{display:none}.mobile-more-menu{position:absolute;right:calc(12px + env(safe-area-inset-right));top:calc(72px + env(safe-area-inset-top));z-index:14;display:grid;gap:calc(8px * var(--ui));padding:calc(12px * var(--ui));border-radius:calc(18px * var(--ui));background:var(--cream);box-shadow:0 8px 30px #244a4133;max-width:calc(100% - 24px);max-height:65dvh;overflow:auto}
.mobile-more-menu .menu-button{position:static}.mobile-more-menu button{width:100%;white-space:normal}.mobile-more-menu .cam-label{border-radius:calc(14px * var(--ui))}
html,body{max-width:100%;overflow-x:clip}button{overflow-wrap:anywhere}#panelBody{overscroll-behavior:contain}.panel-header h2{min-width:0;overflow-wrap:anywhere}.panel-header .close{flex-shrink:0}
@media (max-width:499px),(max-height:499px){
 :root{--ui:1.2;--min-font:16px}
 button,input,select,textarea{min-width:48px;min-height:48px}
 button{font-size:max(15px,calc(13px * var(--ui)))}
 .island-shell header{top:calc(12px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));right:120px;height:48px}
 .island-shell .brand{display:none}.island-shell .header-right{margin-left:0;gap:8px;flex-wrap:wrap}.island-shell .header-right .logout{display:none}
 .island-shell #connection{font-size:0;min-width:24px;width:24px;height:24px;padding:7px;gap:0}.island-shell #connection .live-dot{margin:0}
 .island-shell .coin{padding:8px 12px;font-size:16px}.island-shell .coin b{font-size:20px}
 .mobile-more{display:block;position:absolute;right:calc(12px + env(safe-area-inset-right));top:calc(12px + env(safe-area-inset-top));z-index:14;min-height:48px;padding:10px 14px}
 .location{top:calc(74px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));max-width:calc(100% - 90px);padding:8px 12px;pointer-events:none}
 .location strong{margin:0}.location span{font-size:16px}
 .goal{top:calc(156px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));right:80px;bottom:auto;max-width:none;transform:none;width:auto;padding:10px 12px;text-align:left;white-space:normal}
 .goal strong{font-size:16px;line-height:1.5}.goal span{display:none}
 .camera-controls,.has-activity .camera-controls{right:calc(12px + env(safe-area-inset-right));top:50%;transform:translateY(-50%);gap:8px}
 .camera-controls button{width:48px;height:48px;min-height:48px;font-size:24px}
 .actions,.teacher-shell .actions,.has-activity .actions{left:calc(90px + env(safe-area-inset-left));right:calc(8px + env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom));gap:5px;align-items:end;justify-content:space-between}
 .action-stack,.teacher-shell .action-stack,.has-activity .action-stack{display:flex;gap:5px;max-width:none;flex:1;min-width:0;align-items:end}
 .action-stack button{padding:6px 3px;min-width:48px;min-height:56px;flex:1;font-size:15.6px;line-height:1.35}
 .action-stack [data-cmd=bag]{order:-2}.action-stack [data-cmd=help]{order:-1}.action-stack [data-cmd=resume]:not(.hidden){position:absolute;bottom:78px;right:0;min-width:120px}
 .interact{flex-shrink:0;width:72px;height:72px;min-width:72px;font-size:16px;border-width:3px;line-height:1.3}
 .touch-ui,.has-activity .touch-ui{left:calc(8px + env(safe-area-inset-left));bottom:calc(14px + env(safe-area-inset-bottom));width:74px;height:74px}
 .touch-ui span{left:22px;top:22px;width:26px;height:26px}.touch-ui:after{left:20px;bottom:-12px;font-size:16px}
 .side-menu{top:calc(72px + env(safe-area-inset-top));right:12px;width:calc(100% - 24px);max-height:calc(100dvh - 180px);z-index:15}
 .sidebar-close,.close{width:48px;height:48px;min-height:48px;min-width:48px}.destination small{font-size:16px}.destination{padding:12px}
 dialog{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:100%;max-height:85dvh;border-radius:24px 24px 0 0}
 #panelBody{padding:calc(16px * var(--ui));padding-bottom:calc(16px * var(--ui) + env(safe-area-inset-bottom));max-height:calc(85dvh - 2px)}
 .tabs button,.card button,.teacher-shell .action-stack button{min-height:48px;min-width:48px;font-size:16px}
 .cards,.item-collection .cards{grid-template-columns:repeat(2,minmax(0,1fr))}.card{min-width:0}.card .row{align-items:stretch}.card button{max-width:100%}
 .collection-controls .tabs{flex-wrap:wrap;overflow:visible}.collection-controls .tabs button{white-space:normal;flex:0 1 auto}
 .world-prompt{font-size:calc(16px * var(--ui));min-height:48px;min-width:142px;padding:10px 14px}
 .trip-caption{top:calc(12px + env(safe-area-inset-top));font-size:calc(16px * var(--ui));padding:calc(10px * var(--ui)) calc(14px * var(--ui))}
 .teacher-announce{top:calc(260px + env(safe-area-inset-top));width:calc(100% - 90px);left:12px;transform:none;font-size:16px}.teacher-announce span{font-size:calc(16px * var(--ui))}
 .gift-action-notice{top:250px;left:12px;right:80px;transform:none;max-width:none;flex-wrap:wrap}.travel-note{font-size:16px;max-width:calc(100% - 24px)}
 .activity-panel{left:8px;right:8px;bottom:100px;max-height:40dvh;width:auto}.has-activity .goal{display:none}
 .edit-home{top:auto;bottom:104px;right:12px;min-height:48px}.edit-drawer{width:auto;max-height:60dvh}.edit-tools button{min-width:48px;min-height:48px}
 #toast{bottom:calc(104px + env(safe-area-inset-bottom));font-size:16px;max-height:45dvh;overflow:auto}
 .island-shell:has(~dialog[open]) .actions{pointer-events:none}
}
@media (max-height:449px) and (min-width:500px){
 .island-shell header{right:230px}.location{top:calc(72px + env(safe-area-inset-top));max-width:260px}
 .goal{top:calc(12px + env(safe-area-inset-top));left:270px;right:130px;min-height:48px;padding:8px 12px}
 .goal strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .camera-controls,.has-activity .camera-controls{top:calc(92px + env(safe-area-inset-top));transform:none;display:grid;grid-template-columns:48px 48px;gap:8px}
 .camera-controls button:last-child{grid-column:2}
 .actions,.teacher-shell .actions,.has-activity .actions{left:auto;width:340px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom))}
 .touch-ui,.has-activity .touch-ui{width:86px;height:86px;left:16px;bottom:20px}.touch-ui span{left:29px;top:29px}
 dialog{inset:0 0 0 auto;width:60%;max-width:60%;height:100dvh;max-height:100dvh;border-radius:24px 0 0 24px}
 #panelBody{max-height:calc(100dvh - 2px);padding-right:calc(16px * var(--ui) + env(safe-area-inset-right))}
 .side-menu{width:60%;max-height:calc(100dvh - 90px)}.teacher-announce{top:130px;max-width:calc(100% - 180px);flex-direction:row}.gift-action-notice{top:140px;max-width:60%}
 .edit-home{bottom:104px;right:130px}.activity-panel{right:130px;left:auto;top:82px;bottom:100px;max-height:none;width:50%}
}
.island-shell:has(.trip-caption:not(.hidden)) :is(header,.location,.goal,.actions,.camera-controls,.touch-ui,.mobile-more,.edit-home){visibility:hidden}
@media (max-width:499px),(max-height:499px){[data-skip-transition]{min-width:48px;min-height:48px;right:calc(12px + env(safe-area-inset-right))!important;bottom:calc(12px + env(safe-area-inset-bottom))!important}}
.island-shell:has(.mobile-more-menu:not(.hidden)) .goal{visibility:hidden}
.island-shell:has(.mobile-more-menu:not(.hidden)) .camera-controls{visibility:hidden}
.mobile-filter{display:none}
@media (max-width:499px),(max-height:499px){.collection-controls .tabs{display:none}.mobile-filter{display:block;font-size:16px;margin:8px 0}.mobile-filter select{min-height:48px;margin-top:4px;padding:8px 12px}.celebration-banner{top:calc(250px + env(safe-area-inset-top));left:12px;transform:none;width:calc(100% - 90px);max-width:500px;font-size:calc(18px * var(--ui))}}
.island-shell:has(.mobile-more-menu:not(.hidden)) .actions{visibility:hidden}
/* V6: keep the weather badge above the controls, with its own space on phones. */
.environment-label{position:absolute;left:calc(24px * var(--ui));bottom:calc(178px * var(--ui));z-index:3;min-height:48px;max-width:calc(100% - 48px);padding:10px 16px;border:1px solid #fff8de;background:#fff9e9ed;box-shadow:0 4px 18px #244a4124;font-size:16px;line-height:1.4;text-align:left;overflow-wrap:anywhere}
.board-shell .environment-label{bottom:calc(24px * var(--ui));left:auto;right:calc(24px * var(--ui))}
.environment-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.environment-fields select{min-height:48px}.environment-fields label{min-width:0}
.island-shell:has(.trip-caption:not(.hidden)) .environment-label{visibility:hidden}
@media (max-width:499px),(max-height:499px){
 .island-shell header{top:calc(70px + env(safe-area-inset-top))}
 .island-shell .environment-label{top:calc(12px + env(safe-area-inset-top));bottom:auto;left:calc(12px + env(safe-area-inset-left));max-width:calc(100% - 132px);padding:8px 12px}
 .island-shell .location{top:calc(132px + env(safe-area-inset-top))}
 .island-shell .goal{top:calc(214px + env(safe-area-inset-top))}
 .island-shell .teacher-announce{top:calc(318px + env(safe-area-inset-top))}
 .board-shell .environment-label{bottom:12px;right:12px;max-width:calc(100% - 24px)}
}
@media (max-height:449px) and (min-width:500px){
 .island-shell .environment-label{max-width:248px}
 .island-shell .location{max-width:260px}
 .island-shell .goal{top:12px;left:280px}
}

/* V7: fullscreen keeps all controls clear of display cutouts. */
:fullscreen{background:var(--cream)}
:-webkit-full-screen{background:var(--cream)}
.island-shell>header,.board-shell>header{top:calc(14px * var(--ui) + env(safe-area-inset-top));left:calc(16px * var(--ui) + env(safe-area-inset-left));right:calc(16px * var(--ui) + env(safe-area-inset-right))}
.camera-controls{right:calc(24px * var(--ui) + env(safe-area-inset-right))}
.board-shell .camera-controls{left:calc(25px * var(--ui) + env(safe-area-inset-left))}
.board-shell .board-sidebar{right:calc(24px * var(--ui) + env(safe-area-inset-right))}
.board-shell .board-caption{left:calc(25px * var(--ui) + env(safe-area-inset-left));bottom:calc(25px * var(--ui) + env(safe-area-inset-bottom))}
#panel{max-width:min(calc(650px * var(--ui)),calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));max-height:min(88dvh,calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)))}
.login,.customizer{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.fullscreen-hint{line-height:1.6}
.exit-page{min-height:100dvh;display:grid;place-items:center;padding:calc(24px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));text-align:center;background:var(--cream)}
.exit-page section{max-width:640px}.exit-page h1{font-size:clamp(24px,4vw,36px);line-height:1.6}.exit-page button{min-width:160px;min-height:48px}
@media (max-width:499px),(max-height:499px){
 .island-shell>header,.board-shell>header{top:calc(12px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));right:calc(120px + env(safe-area-inset-right))}
 .header-right .exit-button,.board-shell .header-right [data-cmd="logout"]{display:none}
 .board-shell .brand{display:none}.board-shell .header-right{flex-wrap:wrap}
 .board-shell .camera-controls{left:calc(14px + env(safe-area-inset-left));bottom:calc(120px + env(safe-area-inset-bottom))}
 .island-shell .camera-controls{right:calc(12px + env(safe-area-inset-right))}
 #panel{left:env(safe-area-inset-left);right:env(safe-area-inset-right);width:calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right));max-width:none;max-height:min(85dvh,calc(100dvh - env(safe-area-inset-top)))}
}
@media (max-height:449px) and (min-width:500px){
 .island-shell>header{right:calc(230px + env(safe-area-inset-right))}
 #panel{left:auto;right:env(safe-area-inset-right);top:env(safe-area-inset-top);width:calc(60% - env(safe-area-inset-right));max-width:60%;height:calc(100dvh - env(safe-area-inset-top));max-height:calc(100dvh - env(safe-area-inset-top))}
}
/* V7 私人島經營 */
.island-quest-lines{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.island-quest-lines .card{text-align:left;min-width:0}
.island-quest-lines progress{width:100%;accent-color:#397849}
.island-quest-lines ol{padding-left:24px;line-height:1.8}
.park-score{font-weight:700;color:#315f3b;background:#e9f1dd;padding:10px 14px;border-radius:12px}
.compost-inputs{display:grid;gap:12px;margin:16px 0}
.compost-inputs label{display:grid;gap:6px}
.compost-inputs select{min-height:44px;padding:8px;font:inherit}
@media(max-width:700px){.island-quest-lines{grid-template-columns:1fr}}
/* Island-native games, full-screen dialog. */
#panel.park-panel{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;padding:0;border:0;border-radius:0;overflow:hidden;background:#faf7ed}
.park-panel #panelBody{height:100%;max-height:none;display:flex;flex-direction:column;padding:0;overflow:hidden}
.park-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left));background:#365b49;color:#fff;flex-shrink:0}
.park-toolbar h2{font-size:18px;margin:0;color:inherit}.park-toolbar button{min-height:44px;white-space:nowrap}
@media(max-width:500px){.park-toolbar{gap:6px}.park-toolbar h2{font-size:16px}.park-toolbar button{font-size:14px;padding:8px}.park-panel #panelBody{max-height:none}}

.park-native {--primary:#365b49;--accent:#bc6c43;--line:#d8d2bd;--ink:#283e35;--muted:#637166;--ok:#39854e;--bad:#ba4242;
.math-pick, .math-result { max-width: 1100px; margin: 0 auto; padding: 20px; text-align: center; min-height: calc(100vh - 60px); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; }
.math-pick h1 { font-size: 40px; margin: 0; }
.name-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; }
.name-btn { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 18px 10px; font: inherit; cursor: pointer; box-shadow: 0 4px 0 var(--line); touch-action: manipulation; }
.name-btn:active { transform: translateY(3px); box-shadow: none; }
.name-btn-name { font-size: 34px; font-weight: 700; }
.name-btn-sub { color: var(--muted); font-size: 18px; }
.math-stage { min-height: calc(100vh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 20px 20px 70px; gap: 22px; position: relative; }
.math-top { position: absolute; top: 16px; left: 20px; right: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.math-player { font-size: 32px; font-weight: 800; }
.math-clock { font-size: 44px; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--primary); min-width: 140px; text-align: right; }
.math-progress { display: flex; gap: 8px; }
.dot { width: 22px; height: 22px; border-radius: 50%; background: #e6e0d3; }
.dot.done { background: var(--ok); }
.dot.now { background: var(--accent); transform: scale(1.25); }
.math-hint { font-size: 24px; color: var(--muted); }
.math-question { font-size: 120px; font-weight: 800; display: flex; gap: 30px; align-items: center; line-height: 1; font-variant-numeric: tabular-nums; }
.q-blank { color: var(--accent); border-bottom: 8px solid var(--accent); min-width: 1.2em; text-align: center; }
.math-options { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.opt-btn { min-width: 170px; height: 150px; font-size: 76px; font-weight: 800; border-radius: 22px; border: 3px solid var(--line); background: #fff; cursor: pointer; box-shadow: 0 6px 0 var(--line); touch-action: manipulation; font-variant-numeric: tabular-nums; color: var(--ink); }
.math-options-ten .opt-btn { min-width: 120px; height: 130px; font-size: 64px; }
.opt-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.opt-btn.right { background: #dff5e7; border-color: var(--ok); color: var(--ok); }
.opt-btn.wrong { background: #fde4e4; border-color: var(--bad); color: var(--bad); animation: shake .3s; opacity: .55; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.math-quit { position: absolute; bottom: 12px; right: 16px; }
.countdown { font-size: 220px; font-weight: 900; color: var(--accent); margin-bottom: 15vh; }
.result-time { font-size: 110px; font-weight: 900; color: var(--primary); }
.star-award { font-size: 34px; font-weight: 700; padding: 14px 28px; border-radius: 18px; background: #fff; border: 2px solid var(--line); }
.star-icon { font-size: 60px; margin-right: 10px; vertical-align: middle; }
.star-detail { font-size: 22px; font-weight: 400; color: var(--muted); margin-top: 6px; }
.star-gold { background: #fff6d6; border-color: #e5b92a; }
.star-silver { background: #f1f3f6; border-color: #a9b2bf; }
.star-bronze { background: #fbeee3; border-color: #c98a55; }
.minus-stage {
  --cell: clamp(78px, 15vh, 132px);
  --gap: calc(var(--cell) * 0.34);
  --box: calc(var(--cell) * 0.42);
  --btn: clamp(76px, 13vh, 112px);
  height: calc(100vh - 56px); display: flex; flex-direction: column; position: relative;
  padding: calc(var(--cell) * 0.6) 20px 14px; gap: calc(var(--cell) * 0.12);
}
.minus-top { position: absolute; top: 12px; left: 20px; right: 20px; }
.minus-area { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--cell) * 0.22); }
.minus-status { min-height: calc(var(--cell) * 0.55); text-align: center; }
.ms-text { font-size: calc(var(--cell) * 0.26); font-weight: 800; }
.ms-done { font-size: calc(var(--cell) * 0.36); color: var(--ok); }
.ms-hint { font-size: calc(var(--cell) * 0.2); color: #9a4a08; margin-top: 4px; }
.minus-grid { display: grid; column-gap: var(--gap); row-gap: calc(var(--cell) * 0.06); align-items: center; font-variant-numeric: tabular-nums; }
.mg-cell { width: var(--cell); height: calc(var(--cell) * 0.96); position: relative; display: flex; align-items: center; justify-content: center; border-radius: 16px; }
.mg-cell.cur { background: #fff3c4; }
.mg-num { font-size: calc(var(--cell) * 0.78); font-weight: 800; line-height: 1; position: relative; }
/* 被借位：劃一撇 */
.mg-num.struck::after { content: ""; position: absolute; left: 50%; top: 50%; width: 120%; border-top: 8px solid #2f6fd6; transform: translate(-50%, -50%) rotate(-60deg); border-radius: 4px; }
.mg-op { font-size: calc(var(--cell) * 0.64); font-weight: 800; text-align: center; }
.mg-line { border-top: 8px solid var(--ink); }
.mg-ans .mg-num { color: var(--primary); }
.mg-ans.active { outline: 5px dashed var(--accent); outline-offset: -5px; }
/* 右上角的小框框：紅框（合十）、藍框（借位後的數）、橘框（進位）；放在數字和數字之間的空白，不壓到旁邊的數字 */
.mbox { position: absolute; top: calc(var(--box) * -0.3); right: calc(var(--box) * -0.55); width: var(--box); height: var(--box); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: calc(var(--box) * 0.66); font-weight: 900; z-index: 2; }
.mbox-red { border: 5px solid var(--bad); color: var(--bad); }
.mbox-blue { border: 5px solid #2f6fd6; color: #2f6fd6; }
.mbox.active { animation: blink 1s infinite; box-shadow: 0 0 0 6px #ffe08a; }
@keyframes blink { 50% { transform: scale(1.12); } }
/* 下方按鈕區：只有「減得了／減不了」或「0～9」 */
.minus-controls { min-height: calc(var(--btn) + 16px); display: flex; gap: calc(var(--btn) * 0.14); justify-content: center; align-items: center; flex-wrap: wrap; padding: 0 150px; }
.minus-controls .opt-btn { min-width: calc(var(--btn) * 0.9); height: var(--btn); font-size: calc(var(--btn) * 0.52); }
.minus-controls.mode-judge { gap: 48px; }
.minus-controls .opt-btn.opt-wide { min-width: calc(var(--btn) * 2.7); font-size: calc(var(--btn) * 0.42); }
.minus-levels { justify-content: center; padding: 0; }

/* ---------- 乘法直式 ---------- */
.mbox-orange { border: 5px solid #e8771e; color: #c25e10; }
.pop { animation: pop .6s ease-out; }
@keyframes pop { 0% { transform: scale(1.8); opacity: .2; } 60% { transform: scale(1.15); opacity: 1; } }
.ms-auto { color: var(--ok); }
}
/* Fit the original question/vertical layout into the island toolbar and safe area. */
#panel.park-panel{inset:0;left:0;right:0;top:0;max-width:100%;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
#parkGameHost{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;color:#283e35;font-size:18px}
.park-game-content{min-height:100%;width:100%}
.park-native button,.park-native .btn,.park-board-tabs button{min-width:44px;min-height:44px;font-size:18px;touch-action:manipulation}
.park-native .btn{display:inline-flex;align-items:center;justify-content:center;padding:12px 20px;background:#eee8d6;border-radius:14px;text-decoration:none}
.park-native .row-gap{display:flex;gap:12px;flex-wrap:wrap;justify-content:center}
.park-native .name-grid{display:block;max-width:480px}.park-native .name-btn{width:100%}
.park-native .math-pick,.park-native .math-result{min-height:calc(100dvh - 76px);padding:24px 16px}
.park-native .math-stage{min-height:calc(100dvh - 76px);padding:100px 20px 72px;gap:28px;justify-content:center}
.park-native .math-top{position:absolute;top:16px;gap:12px}
.park-native .math-question{font-size:clamp(40px,8vw,90px);gap:clamp(8px,2.5vw,28px)}
.park-native .math-options{width:100%;max-width:940px;display:grid;grid-template-columns:repeat(5,minmax(44px,1fr));gap:14px}
.park-native .opt-btn{min-width:44px;padding:6px;height:clamp(64px,14dvh,116px);font-size:clamp(28px,5vw,60px)}
.park-native .math-options-ten{max-width:760px}.park-native .math-options-ten .opt-btn{min-width:44px;height:clamp(64px,13dvh,100px);font-size:clamp(28px,5vw,56px)}
.park-native .minus-stage{--cell:clamp(40px,min(11dvh,15vw),92px);--btn:clamp(48px,10dvh,80px);height:calc(100dvh - 70px);min-height:480px;padding:70px 16px 56px;gap:10px}
.park-native .minus-area{min-height:240px;gap:20px}.park-native .minus-status{min-height:42px;max-width:850px;line-height:1.5}
.park-native .ms-text{font-size:clamp(18px,2.4vw,24px)}.park-native .ms-hint{font-size:16px}
.park-native .minus-controls{padding:0;max-width:680px;width:100%;align-self:center;display:grid;grid-template-columns:repeat(5,minmax(44px,1fr));gap:10px}
.park-native .minus-controls.mode-judge{grid-template-columns:repeat(2,minmax(44px,1fr));max-width:600px}
.park-native .minus-controls.mode-none{display:block;min-height:80px}.park-native .minus-controls .opt-btn{min-width:44px;width:100%;height:var(--btn);font-size:clamp(24px,4vw,44px)}
.park-native .minus-controls .opt-btn.opt-wide{min-width:44px;font-size:clamp(20px,3vw,32px)}
.park-native .countdown{margin:0}.park-native .result-time{font-size:clamp(48px,10vw,88px)}
.park-native .star-award{font-size:clamp(22px,3vw,32px)}.park-native .star-detail{font-size:18px}
.park-native .park-result-message{padding:12px 18px;border-radius:14px;background:#fff0c2;color:#365b49;font-weight:700}
.park-native .park-keyboard{position:absolute;bottom:8px;left:16px;color:#637166;font-size:14px}
.park-leaderboard{max-width:1100px;margin:auto;padding:20px}.park-leaderboard h1{font-size:clamp(24px,4vw,36px)}
.park-native .tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}.park-native .tab{border-radius:12px;padding:12px 16px}.park-native .tab.active{background:#365b49;color:#fff9e9}
.park-native .table{border-collapse:collapse;width:100%;font-size:20px}.park-native .table th,.park-native .table td{text-align:left;border-bottom:1px solid #d8d2bd;padding:14px 10px}.park-native .table .mine{background:#e2ecd7}
.park-my-best{background:#fff9e9;border:1px solid #d8d2bd;border-radius:18px;margin:20px 0;padding:18px}.park-my-best li{margin:10px 0;line-height:1.6}
.park-board-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
@media(max-width:600px){
 .park-native .math-pick h1{font-size:30px}.park-native .name-btn-name{font-size:26px}
 .park-native .math-player{font-size:18px}.park-native .math-clock{font-size:28px;min-width:60px}.park-native .math-progress{gap:4px}.park-native .dot{width:10px;height:10px}
 .park-native .math-hint{font-size:18px}.park-native .math-options{grid-template-columns:repeat(3,minmax(44px,1fr));gap:10px}.park-native .math-question{font-size:clamp(36px,9vw,52px);gap:8px}
 .park-native .math-stage{padding:90px 12px 70px;gap:24px}.park-native .math-top{left:12px;right:12px}
 .park-native .minus-stage{--cell:clamp(36px,min(10dvh,14vw),72px);padding:70px 12px 56px}.park-native .mbox{border-width:3px;border-radius:6px}.park-native .minus-controls{gap:6px}
 .park-native .star-award{padding:14px}.park-native .table{font-size:17px}.park-leaderboard{padding:16px 12px}
}
@media(max-height:500px) and (min-width:600px){
 .park-native .math-stage{min-height:400px;gap:12px}.park-native .math-question{font-size:48px}.park-native .opt-btn{height:64px;font-size:36px}
}
@media(prefers-reduced-motion:reduce){.park-native .mbox.active,.park-native .wrong,.park-native .pop{animation:none}}

/* Task 41: scoped original handwriting, composition and monster UI. */
.park-native {
 --bg:#f8f3e7;--panel:#fffaf0;--text:#304d44;--muted:#60796d;--primary:#386d5e;--border:#d8d8bc;--danger:#b64134;--accent:#c28034;
 .hz-stage { height: 100vh; display: flex; flex-direction: column; position: relative; background: var(--bg); }
.hz-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.hz-lesson { font-weight: 700; white-space: nowrap; font-size: 18px; color: var(--muted); }
.char-chips { display: flex; gap: 8px; overflow-x: auto; flex: 1; padding: 2px; }
.char-chip { font-family: var(--kai); font-size: 34px; min-width: 60px; height: 60px; border-radius: 12px; border: 2px solid var(--line); background: #fff; cursor: pointer; position: relative; color: var(--ink); }
.char-chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.char-chip.done::after { content: "✓"; position: absolute; top: -4px; right: 2px; font-size: 14px; color: var(--ok); font-family: sans-serif; }
.char-chip.on.done::after { color: #bff0d2; }
.char-chip:disabled { opacity: .35; }
.hz-bar-right { display: flex; gap: 8px; }

.hz-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(190px, 15fr) minmax(250px, 24fr) minmax(400px, 40fr) minmax(240px, 21fr); gap: 8px; padding: 8px; }
.hz-col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; }
.col-title { font-weight: 700; color: var(--muted); font-size: 17px; }

.score-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; flex: 0 1 auto; }
.score-row { display: flex; justify-content: space-between; padding: 2px 8px; border-radius: 8px; font-size: 18px; }
.score-row.now { background: #fff1e4; font-weight: 700; }
.phase-label { font-size: 17px; font-weight: 700; padding: 5px 10px; border-radius: 10px; background: #eef3fb; color: var(--primary); text-align: center; }
.phase-observe { background: #fff1e4; color: #9a4a08; }
.phase-done { background: #e6f5ec; color: var(--ok); }
.queue { display: flex; flex-wrap: wrap; gap: 4px; font-size: 16px; align-items: center; }
.q-name { background: #f2efe7; padding: 2px 8px; border-radius: 8px; }
.current-card { text-align: center; padding: 6px 4px; border: 3px solid var(--accent); border-radius: 16px; background: #fffaf4; }
.cur-label { font-size: 16px; color: var(--muted); }
.cur-name { font-size: 36px; font-weight: 900; line-height: 1.2; word-break: keep-all; }
.cur-name.teacher { color: var(--primary); }
.col-turn .btn { width: 100%; flex-direction: column; gap: 0; min-height: 44px; font-size: 19px; padding: 4px 8px; flex: none; }
.col-turn .btn-xl { min-height: 56px; font-size: 22px; }
.hz-col .btn-xl { min-height: 54px; font-size: 22px; padding: 6px 16px; flex: none; }

/* 字與作答區依欄位的寬、高自動縮放成最大的正方形，不會擠掉下面的按鈕 */
.fit-wrap { flex: 1 1 0; min-height: 0; min-width: 0; container-type: size; display: flex; align-items: flex-end; justify-content: center; }
.fit-wrap > svg { width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); flex: none; }
.picker-svg { background: #fffdf8; border: 2px solid var(--line); border-radius: 12px; touch-action: none; cursor: pointer; }
.pk-stroke { fill: #3d4350; transition: fill .1s; }
.pk-stroke.sel { fill: var(--sel); }
.tian-grid line { stroke: #e9b3a3; stroke-width: 3; stroke-dasharray: 18 14; }
.tian-border { fill: none; stroke: #e9b3a3; stroke-width: 6; }
.comp-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: none; }
.comp-chip { font-family: var(--kai); font-size: 24px; min-width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.comp-chip.on { border-color: var(--sel); background: #fff1e4; color: #9a4a08; }
.sel-info { font-size: 15px; min-height: 20px; flex: none; }
.tool-row { display: flex; gap: 6px; flex: none; }
.tool-row .btn { flex: 1; padding: 4px; min-height: 44px; font-size: 18px; }

.pad-row { flex: 1 1 0; min-height: 0; display: flex; gap: 8px; align-items: stretch; }
.pad-svg { background: #fffdf8; border-radius: 12px; touch-action: none; }
.pad-svg[data-mode="draw"] { cursor: crosshair; }
.pad-svg[data-mode="move"] { cursor: grab; }
.piece path { fill: var(--piece); }
.ink { fill: none; stroke: #111; stroke-linecap: round; stroke-linejoin: round; }
.ink-dot { fill: #111; }
.piece-box { fill: none; stroke: #9aa7bd; stroke-width: 4; stroke-dasharray: 14 10; }
.piece-box.active { stroke: var(--accent); stroke-width: 6; }
.piece-handle { fill: var(--accent); stroke: #fff; stroke-width: 6; }
.pad-tools { display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; width: 80px; flex: none; }
.tool-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; height: 52px; flex: none; border-radius: 10px; border: 2px solid var(--line); background: #fff; font: inherit; font-size: 15px; cursor: pointer; touch-action: manipulation; color: var(--ink); }
.tool-icon { font-size: 20px; line-height: 1.1; }
.tool-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.submit-btn { width: calc(100% - 88px); }

.res-body { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; }
.res-idle p { margin: 6px 0; color: var(--muted); font-size: 18px; }
.res-loading { display: flex; align-items: center; gap: 12px; font-size: 22px; padding: 20px 0; }
.spinner { width: 34px; height: 34px; border: 5px solid #dfe6f3; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.res-success { text-align: center; background: #effaf3; border: 2px solid #9fd8b4; border-radius: 16px; padding: 10px; }
.res-tag { display: inline-block; background: var(--ok); color: #fff; border-radius: 8px; padding: 2px 10px; font-size: 16px; }
.res-char { font-size: 130px; line-height: 1.1; }
.res-zhuyin { font-size: 34px; font-weight: 700; letter-spacing: 2px; }
.res-def { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.reading-box { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.reading-alt { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; font-size: 15px; }
.speak-src { font-size: 14px; }
.res-score { font-size: 26px; font-weight: 800; color: var(--ok); }
.res-score.muted { font-size: 18px; font-weight: 400; color: var(--muted); }
.res-confirm-title { font-size: 26px; font-weight: 800; color: #9a4a08; }
.reasons { margin: 0; padding-left: 20px; font-size: 16px; color: #7a4a14; }
.cand-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cand-btn { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.cand-btn .kai { font-size: 56px; line-height: 1.1; }
.cand-zy { font-size: 15px; color: var(--muted); min-height: 18px; }
.manual { display: flex; gap: 6px; align-items: center; font-size: 17px; }
.manual-input { width: 70px; font-size: 30px; text-align: center; padding: 4px; font-family: var(--kai); }
.res-error { color: var(--bad); }
.res-rejected { font-size: 20px; color: var(--muted); }
.engine-details { font-size: 14px; color: var(--muted); }
.engine-details ul { margin: 4px 0; padding-left: 18px; }
.made-list { border-top: 1px dashed var(--line); padding-top: 6px; }
.made-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.made { display: inline-flex; align-items: baseline; gap: 4px; font-size: 14px; background: #f2efe7; border-radius: 8px; padding: 2px 8px; border: 1px solid transparent; cursor: pointer; font-family: inherit; color: inherit; }
.made:hover { border-color: var(--bad); }
.made-x { color: #b0a8a0; font-size: 12px; margin-left: 2px; }
.made:hover .made-x { color: var(--bad); }
.made b { font-size: 26px; font-weight: 400; }
.made.by-teacher { background: #eef3fb; }
.res-summary h3 { margin: 4px 0 8px; }

.col-pad { position: relative; }
.observe-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.observe-box { background: #fffffff0; border: 3px solid var(--accent); border-radius: 22px; padding: 20px 50px; text-align: center; font-size: 28px; font-weight: 700; box-shadow: 0 10px 30px #0002; }
.observe-num { font-size: 120px; color: var(--accent); line-height: 1; }
.teacher-banner { background: #24324d; color: #fff; padding: 8px 16px; font-size: 20px; text-align: center; }

/* ---------- 設定 ---------- */
.settings { max-width: 1200px; margin: 0 auto; }
.settings h1 { margin: 20px 16px 0; }
.lesson-edit { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; }
.lesson-edit.new { border-color: var(--accent); background: #fffaf4; }
.lesson-fields { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.chars-input { font-family: var(--kai); font-size: 28px; }
.char-check { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.cc { font-family: var(--kai); font-size: 24px; padding: 0 6px; border-radius: 6px; background: #eef3fb; }
.cc.missing { background: #fde4e4; color: var(--bad); text-decoration: line-through; }
.warn-text { width: 100%; color: var(--bad); font-size: 16px; }
.ocr-box { border: 2px dashed var(--accent); border-radius: 12px; padding: 12px; margin: 10px 0; }
.ocr-img { max-width: 100%; max-height: 360px; display: block; margin-bottom: 8px; }
.star-inputs { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }

@media (max-width: 900px) {
  .home-grid, .board-cols, .set-grid, .lesson-fields { grid-template-columns: 1fr; }
  .name-grid { grid-template-columns: repeat(2, 1fr); }
}

.col-turn .tool-row .btn { font-size: 16px; white-space: nowrap; padding: 4px 6px; }

/* ---------- 拆字造字：老師列、計時、完整度 ---------- */
.teacher-bar { display: flex; align-items: center; gap: 6px; padding: 4px 12px; background: #f4f1ea; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.teacher-bar .sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.teacher-bar .tiny { margin-left: auto; }
.hz-bar .btn-sm, .teacher-bar .btn-sm { min-height: 36px; }
.turn-timer { text-align: center; font-size: 30px; font-weight: 900; color: var(--primary); background: #eef3fb; border-radius: 14px; padding: 6px; font-variant-numeric: tabular-nums; }
.turn-timer.warn { color: var(--bad); background: #fde4e4; }
.turn-timer.stopped { opacity: .6; font-size: 22px; }
/* 辨識結果完整顯示；「本堂已造出」用剩下的空間，自己捲動 */
.col-result .res-body { flex: 0 1 auto; }
.col-result .made-list { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.res-incomplete { background: #fff7e8; border: 2px solid #f3c28f; border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; font-size: 18px; }
.miss-glyph { width: 150px; height: 150px; background: #fffdf8; border-radius: 10px; border: 1px solid var(--line); }
.miss-glyph .ok { fill: #c9c4b8; }
.miss-glyph .miss { fill: var(--bad); }
/* 全螢幕時，整個遊戲畫面填滿螢幕 */
.hz-stage:fullscreen { height: 100vh; width: 100vw; background: var(--bg); }


/* ---------- 全國排名、獎勵 ---------- */
.national-rank { font-size: 26px; font-weight: 800; color: var(--primary); }
.table tr.mine td { background: #fff6d6; }
.reward-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 24px; background: #fffaf0; border: 3px solid #f0e2c4; border-radius: 18px; }
.reward-energy { font-size: 26px; font-weight: 800; color: #c25e10; }
.reward-energy .muted { font-size: 18px; margin-left: 8px; }
.chest-btn { background: linear-gradient(#ffd75e, #ffb020); border-color: #d99000; color: #5a3a00; font-size: 26px; font-weight: 900; animation: chestGlow 1.4s infinite; }
@keyframes chestGlow { 50% { box-shadow: 0 0 0 8px #ffe08a; } }

/* 寶箱三選一 */
.chest-modal { max-width: 900px; width: 92vw; text-align: center; }
.chest-msg { font-size: 30px; font-weight: 900; margin-bottom: 16px; }
.chest-row { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.chest-card { width: 230px; min-height: 270px; border-radius: 22px; border: 5px solid #d99000; background: linear-gradient(#fff3c4, #ffd36b); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: transform .2s; font: inherit; }
.chest-card:not(:disabled):hover { transform: translateY(-6px) rotate(-2deg); }
.chest-face { font-size: 120px; line-height: 1; }
.chest-label { font-size: 22px; font-weight: 800; }
.chest-card.flipped { animation: flip .5s ease-out; background: #fff; cursor: default; }
.chest-card.picked { border-color: #ff8a00; box-shadow: 0 0 0 8px #ffe08a; }
.chest-card.other { opacity: .45; transform: scale(.9); }
.chest-art .monster-svg { width: 190px; height: 190px; }
@keyframes flip { 0% { transform: rotateY(90deg); } 100% { transform: rotateY(0); } }

/* 怪獸卡 */
.monster-svg { display: block; width: 100%; height: auto; }
.mcard { background: #fff; border: 4px solid #e6dfcf; border-radius: 20px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mcard.owned.rarity-2 { border-color: #6b9bf0; }
.mcard.owned.rarity-3 { border-color: #f0b400; box-shadow: 0 0 18px #ffd86b; }
.mcard-art { width: 100%; max-width: 220px; }
.mcard-name { font-size: 22px; font-weight: 900; }
.mcard-rarity { color: #e0a000; font-size: 16px; margin-left: 6px; }
.mcard-stats { font-size: 16px; line-height: 1.5; text-align: left; width: 100%; padding: 0 6px; }
.mcard-skill { margin-top: 4px; color: #9a4a08; font-weight: 700; }
.mcard-pieces { font-size: 18px; font-weight: 800; color: var(--muted); }
.new-monster .mcard { max-width: 320px; margin: 0 auto 10px; }
.monster-page { padding: 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.monster-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.monster-head h1 { margin: 0; }
.monster-sum { font-size: 22px; font-weight: 800; }
.mcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* 大魔王 */
.boss-page { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 24px; padding: 16px 24px; height: calc(100vh - 56px); }
.boss-left { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.boss-title { font-size: 30px; font-weight: 900; }
.hp-bar { position: relative; height: 38px; background: #e9e2d2; border-radius: 20px; overflow: hidden; border: 3px solid #333; }
.hp-fill { height: 100%; background: linear-gradient(90deg, #e8553a, #ff9b4a); transition: width .4s; }
.hp-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; }
.boss-art { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; }
.boss-inner { position: relative; height: 100%; max-height: 64vh; aspect-ratio: 400 / 380; max-width: 100%; }
.boss-inner .boss-svg { width: 100%; height: 100%; display: block; }
.boss-preview { max-height: 40vh; }
.boss-preview .boss-svg { height: 40vh; }
.boss-part { position: absolute; transform: translate(-50%, -50%); background: rgba(255,255,255,.85); border: 2px solid #333; border-radius: 10px; padding: 0 8px; font-size: 16px; font-weight: 800; pointer-events: none; white-space: nowrap; }
.boss-hit { position: absolute; transform: translate(-50%, -50%); font-size: 40px; font-weight: 900; color: #d62020; text-shadow: 0 0 6px #fff, 0 0 10px #fff; animation: hit .9s ease-out forwards; pointer-events: none; }
@keyframes hit { 0% { transform: translate(-50%, -50%) scale(.4); } 30% { transform: translate(-50%, -60%) scale(1.3); } 100% { transform: translate(-50%, -140%) scale(1); opacity: 0; } }
.boss-inner.shake .boss-svg { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-10px) rotate(-2deg); } 75% { transform: translateX(10px) rotate(2deg); } }
.boss-right { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.boss-right h3 { margin: 6px 0 0; }
.boss-go { font-size: 26px; }
.boss-log { max-height: 180px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.log-line { display: flex; align-items: center; gap: 8px; font-size: 18px; background: #fff; border-radius: 10px; padding: 2px 8px; }
.log-line b { color: #d62020; }
.log-mon .monster-svg, .hero-mons .monster-svg { width: 36px; height: 36px; display: inline-block; }
.hero-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.hero-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid #e6dfcf; border-radius: 12px; padding: 4px 10px; font-size: 18px; opacity: .6; }
.hero-row.ready { opacity: 1; border-color: #ffb020; }
.hero-name { font-weight: 800; min-width: 4em; }
.hero-mons { display: flex; gap: 2px; flex: 1; }
.hero-energy { font-weight: 800; color: #c25e10; }
.hero-dmg { color: var(--muted); font-size: 14px; white-space: nowrap; }
.boss-parts { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 16px; }
@media (max-width: 1000px) { .boss-page { grid-template-columns: 1fr; height: auto; } }
.board-admin summary { font-size: 18px; font-weight: 800; cursor: pointer; color: var(--muted); }
.eng-stage { height: calc(100vh - 56px); display: flex; flex-direction: column; padding: 10px 20px 12px; gap: 8px; position: relative; }
.eng-top { position: static; }
.eng-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 20px; }
.eng-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.eng-boss-wrap { position: relative; background: #fff; border: 3px solid #e6dfcf; border-radius: 18px; padding: 8px; text-align: center; }
.eng-boss { position: relative; height: clamp(90px, 22vh, 190px); display: flex; justify-content: center; }
.eng-boss .boss-svg { height: 100%; width: auto; }
.eng-boss.shake .boss-svg { animation: shake .35s; }
.eng-hit { position: absolute; left: 50%; top: 40%; font-size: 64px; animation: hit .8s ease-out forwards; pointer-events: none; }
.eng-hp { height: 22px; margin-top: 6px; }
.eng-combo { min-height: 24px; font-weight: 900; color: #e8551d; font-size: 18px; }
.eng-prompt { flex: 1; min-height: 0; background: #fffaf0; border: 3px solid #f0e2c4; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; }
.eng-speak { width: clamp(80px, 15vh, 120px); height: clamp(80px, 15vh, 120px); border-radius: 50%; border: none; background: var(--primary); color: #fff; font-size: clamp(40px, 8vh, 60px); cursor: pointer; box-shadow: 0 6px 0 #1b4a9a; }
.eng-speak:active { transform: translateY(4px); box-shadow: 0 2px 0 #1b4a9a; }
.eng-show { font-family: "Century Gothic", "Comic Sans MS", Arial, sans-serif; font-size: clamp(64px, 16vh, 120px); font-weight: 700; line-height: 1; color: var(--primary); }
.eng-cue { font-size: clamp(22px, 4.2vh, 32px); font-weight: 900; }
.eng-right { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.eng-feedback { min-height: 40px; font-size: clamp(20px, 3.6vh, 28px); font-weight: 800; display: flex; align-items: center; gap: 10px; }
.eng-feedback.ok { color: var(--ok); }
.eng-feedback.bad { color: var(--bad); }
.eng-pad-wrap { flex: 1; min-height: 0; background: #fff; border: 3px solid #e6dfcf; border-radius: 18px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.eng-pad { width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.eng-pad .eng-line { stroke: #9bb3d6; stroke-width: 3; }
.eng-pad .eng-base { stroke: #e05050; stroke-width: 4; }
.eng-pad .eng-ink path { fill: none; stroke: #1d2a44; stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; }
.eng-model path { fill: none; stroke: #2f6fd6; stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.eng-model path.faint { stroke: #9bb3d6; opacity: .55; stroke-width: 22; }
.eng-num circle { fill: #ff8a00; }
.eng-num text { fill: #fff; font-size: 22px; font-weight: 900; font-family: Arial, sans-serif; }
.eng-mini { height: clamp(70px, 15vh, 120px); width: auto; max-width: 100%; }
.eng-mini .eng-line { stroke: #9bb3d6; stroke-width: 4; }
.eng-mini .eng-base { stroke: #e05050; stroke-width: 5; }
.eng-mini .eng-model path { stroke-width: 16; }
.eng-tools { display: flex; gap: 12px; justify-content: center; padding-right: 130px; }
.eng-tools .btn-lg { font-size: 22px; padding: 10px 22px; }
.eng-submit { font-size: 26px !important; padding: 10px 40px !important; }
.eng-badge-box { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.eng-badge-title { font-size: 22px; font-weight: 900; color: #c25e10; }
.eng-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 1000px; }
.eng-badge { display: inline-flex; flex-direction: column; align-items: center; min-width: 42px; padding: 2px 6px; border-radius: 10px; background: #f2efe7; font-family: "Century Gothic", Arial, sans-serif; }
.eng-badge b { font-size: 20px; }
.eng-badge i { font-style: normal; font-size: 10px; color: #b0a8a0; letter-spacing: 1px; }
.eng-badge.got { background: #fff3c4; }
.eng-badge.got i { font-size: 13px; }
.eng-badge.new { box-shadow: 0 0 0 3px #ffb020; animation: pop .6s ease-out; }

/* ---------- 入口、個人遊戲間 ---------- */
body.mode-entry .topnav, body.mode-me .topnav { display: none; }
.entry { max-width: 1000px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-direction: column; gap: 18px; text-align: center; }
.entry-title { font-size: clamp(30px, 6vw, 46px); margin: 8px 0 0; }
.entry-continue { align-self: center; font-size: 24px; font-weight: 900; padding: 16px 32px; border-radius: 18px; border: none; background: var(--primary); color: #fff; box-shadow: 0 5px 0 #1b4a9a; cursor: pointer; }
.entry-sec { background: #fff; border: 2px solid var(--line); border-radius: 22px; padding: 18px 16px; }
.entry-sec h2 { margin: 0 0 4px; font-size: 26px; }
.entry-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.entry-tab { font: inherit; font-size: 20px; font-weight: 800; padding: 8px 22px; border-radius: 999px; border: 2px solid var(--line); background: #f6f1e6; cursor: pointer; }
.entry-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.entry-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.entry-name { font: inherit; font-size: 24px; font-weight: 800; padding: 16px 6px; border-radius: 16px; border: 2px solid var(--line); background: #fffaf0; box-shadow: 0 4px 0 var(--line); cursor: pointer; touch-action: manipulation; }
.entry-name:active { transform: translateY(3px); box-shadow: none; }
.entry-teacher { background: #f4f1ea; }
.entry-rooms { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.entry-room { font: inherit; font-size: 20px; font-weight: 800; padding: 12px 24px; border-radius: 14px; border: 2px solid #a9b2bf; background: #fff; cursor: pointer; }
.mebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; background: #24324d; color: #fff; position: sticky; top: 0; z-index: 5; }
.mebar-home { color: #ffd98a; font-weight: 900; font-size: 18px; text-decoration: none; }
.mebar-name { font-weight: 700; }

.room { max-width: 1000px; margin: 0 auto; padding: 14px 14px 40px; display: flex; flex-direction: column; gap: 14px; }
.room-head { display: flex; align-items: center; gap: 14px; background: #fff; border: 2px solid var(--line); border-radius: 22px; padding: 12px 16px; }
.room-avatar { width: 84px; height: 84px; flex: none; }
.room-who { flex: 1; min-width: 0; }
.room-name { font-size: clamp(22px, 5vw, 30px); font-weight: 900; }
.room-stats { display: flex; gap: 12px; flex-wrap: wrap; font-weight: 800; color: #c25e10; font-size: 18px; }
.room-chest { font-size: 22px; padding: 10px 16px; }
.room-map { background: #fffaf0; border: 3px solid #f0e2c4; border-radius: 22px; padding: 14px 14px 22px; }
.room-map h2 { margin: 0; font-size: clamp(22px, 5vw, 28px); }
.room-map .muted { margin: 4px 0 10px; }
.room-stations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.room-station { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 18px; border: 3px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); box-shadow: 0 4px 0 var(--line); }
.room-station:active { transform: translateY(3px); box-shadow: none; }
.room-station.done { background: #e9f8ee; border-color: #7fcf98; }
.room-station.lucky:not(.done) { border-color: #f0b400; box-shadow: 0 4px 0 #f0b400; animation: chestGlow 1.6s infinite; }
.rs-icon { font-size: 36px; }
.rs-name { font-size: 20px; font-weight: 900; }
.rs-sub { font-size: 14px; color: var(--muted); }
.room-track { margin: 14px 4px 0; }
.rt-bar { height: 16px; border-radius: 10px; background: #e9e2d2; overflow: hidden; }
.rt-fill { height: 100%; background: linear-gradient(90deg, #ffb020, #ff7a1a); transition: width .4s; }
.rt-goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.rt-goal { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; background: #fff; border: 2px dashed #e6dfcf; text-align: center; }
.rt-goal.ready { border: 2px solid #f0b400; background: #fff6d6; }
.rt-goal.got { border-style: solid; border-color: #7fcf98; background: #e9f8ee; }
.rt-chest { font-size: 30px; line-height: 1; filter: grayscale(1); opacity: .6; }
.rt-goal.got .rt-chest { filter: none; opacity: 1; }
.rt-label { font-size: 13px; color: var(--muted); line-height: 1.3; }
.room-boss { display: flex; align-items: center; gap: 12px; background: #fff; border: 2px solid var(--line); border-radius: 22px; padding: 10px 14px; }
.room-boss-art { width: 80px; height: 76px; flex: none; }
.room-boss-art .boss-svg { width: 100%; height: 100%; }
.room-boss-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.room-boss-name { font-weight: 900; }
.room-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
/* 數字英文：點字母拼字 */
.eng-spell { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(14px, 4vh, 34px); background: #fff; border: 3px solid #e6dfcf; border-radius: 18px; padding: 12px; }
.spell-slots { display: flex; gap: clamp(6px, 1.2vw, 14px); }
.spell-slot { width: clamp(52px, 9vw, 96px); height: clamp(64px, 12vh, 110px); border: none; border-bottom: 6px solid #e05050; background: #f6f9ff; border-radius: 10px 10px 0 0; font-family: "Century Gothic", "Comic Sans MS", Arial, sans-serif; font-size: clamp(40px, 8vh, 72px); color: var(--primary); cursor: pointer; }
.spell-slot.hint { color: #c3d1e6; }
.spell-slot.ok { background: #e2f6e9; color: var(--ok); }
.spell-slot.bad { background: #fde4e4; color: var(--bad); animation: shake .3s; }
.spell-slot.show { background: #fff6d6; color: #c25e10; }
.spell-tiles { display: flex; flex-wrap: wrap; gap: clamp(8px, 1.4vw, 14px); justify-content: center; max-width: 720px; }
.spell-tile { width: clamp(56px, 9vw, 88px); height: clamp(56px, 10vh, 88px); border-radius: 16px; border: 3px solid var(--line); background: #fff; box-shadow: 0 5px 0 var(--line); font-family: "Century Gothic", "Comic Sans MS", Arial, sans-serif; font-size: clamp(32px, 6vh, 52px); font-weight: 700; cursor: pointer; touch-action: manipulation; color: var(--ink); }
.spell-tile:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.spell-tile:disabled { opacity: .25; box-shadow: none; }
.spell-tip { font-size: 15px; }
.table tr.gap td { text-align: center; color: var(--muted); padding: 2px; }

.spell-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 寫國字大挑戰 ---------- */
.zi-prompt { gap: 14px; }
.zi-stage .eng-main { grid-template-columns: minmax(300px, 44%) 1fr; }
.zi-stage .zi-pad-wrap { align-self: center; }
.zi-word { display: flex; align-items: center; gap: 4px; font-family: var(--kai); font-size: clamp(56px, 14vh, 110px); line-height: 1; flex-wrap: wrap; justify-content: center; }
.zi-c { display: inline-block; }
/* 和考卷一樣：方框寫國字，右邊一欄注音 */
.zi-box { display: inline-flex; align-items: stretch; border: 3px solid #555; background: #fff; border-radius: 6px; }
.zi-box-in { width: 1.15em; height: 1.15em; display: flex; align-items: center; justify-content: center; border-right: 2px solid #999; color: var(--ok); }
.zi-box.filled { border-color: var(--ok); background: #effaf3; }
.zy { position: relative; display: flex; align-items: center; justify-content: center; gap: .05em; padding: 0 .12em; font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: .38em; color: #c25e10; font-weight: 700; }
.zy-col { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.zy-tone { align-self: center; font-size: .9em; line-height: 1; margin-top: .4em; }
.zy-light { position: absolute; top: .1em; left: 50%; transform: translateX(-50%); }
.zi-pad-wrap { aspect-ratio: 1 / 1; height: 100%; max-height: 100%; width: auto; max-width: 100%; align-self: center; }
.zi-pad { width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.zi-frame { fill: #fff; stroke: #c96a6a; stroke-width: 8; }
.zi-cross { stroke: #e3b3b3; stroke-width: 4; stroke-dasharray: 22 16; }
.zi-ink path { fill: none; stroke: #1d2a44; stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }
.zi-stroke.solid { fill: #2f6fd6; opacity: .85; }
.zi-stroke.faint { fill: #9bb3d6; opacity: .45; }
.zi-stroke.ok { fill: #9bb3d6; opacity: .5; }
.zi-stroke.miss { fill: var(--bad); }
.zi-brush { fill: none; stroke: #2f6fd6; stroke-width: 150; stroke-linecap: round; stroke-linejoin: round; }
.zi-num circle { fill: #ff8a00; }
.zi-num text { fill: #fff; font-size: 36px; font-weight: 900; font-family: Arial, sans-serif; }
.zi-badges .eng-badge b { font-family: var(--kai); font-size: 24px; font-weight: 400; }
@media (max-width: 760px) {
  .zi-stage .eng-main { grid-template-columns: 1fr; }
  .zi-word { font-size: 46px; }
  .zi-prompt { gap: 6px; }
  .zi-stage .eng-cue { display: none; }
  .zi-stage .zi-pad-wrap { height: auto; width: min(100%, 52vh); }
}
.mebar { height: 44px; box-sizing: border-box; }

}
.park-native .eng-stage{height:auto;min-height:calc(100dvh - 100px);padding:12px}.park-native .eng-main{min-height:0}.park-native .eng-tools button{min-height:44px}.park-native .eng-pad,.park-native .zi-pad,.park-native .picker-svg,.park-native .pad-svg{touch-action:none;width:100%;background:#fffdf8}.park-native .eng-pad-wrap{min-height:180px}.park-native .zi-pad-wrap{max-width:460px}.park-native .boss-page{height:auto;min-height:500px}.park-native .boss-inner{position:relative}.park-native .boss-inner svg{width:100%}.park-native .boss-art{width:100%;max-width:560px}.park-native .hp-bar{position:relative;height:28px;background:#dfdfcc;border-radius:14px;overflow:hidden}.park-native .hp-fill{height:100%;background:#789757}.park-native .hp-text{position:absolute;inset:0;text-align:center;color:#233c31;font-weight:bold}.park-native .park-monster-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px}.park-native .park-hanzi-cols{display:grid;grid-template-columns:1fr 1.3fr;gap:24px}.park-native .park-hanzi-cols section{min-width:0}.park-native .pad-svg,.park-native .picker-svg{max-height:52dvh;border:2px solid #8ca793;border-radius:16px}.park-native .pk-stroke{fill:#40534a}.park-native .pk-stroke.sel{fill:#d58d32}.park-native .ink-layer path{fill:none;stroke:#284939;stroke-width:22;stroke-linecap:round;stroke-linejoin:round}.park-native .tian-grid line{stroke:#b9c3b5;stroke-width:2;stroke-dasharray:12 10}.park-native .tian-border{fill:none;stroke:#8ca793;stroke-width:3}.park-native .park-boss-victory{padding:20px;background:#fff0b5;border-radius:20px;font-size:24px}.park-native .chest-row{display:flex;gap:12px;justify-content:center}.park-native .chest-card{min-width:0;flex:1;padding:12px}.park-native .mcard-art svg{width:100%;max-width:200px}.park-native .row-gap{display:flex;flex-wrap:wrap;gap:8px}.park-native button:focus-visible{outline:3px solid #b66a23;outline-offset:3px}
@media(max-width:760px){.park-native .eng-main,.park-native .zi-stage .eng-main,.park-native .park-hanzi-cols{display:grid;grid-template-columns:1fr;gap:10px}.park-native .eng-side{display:flex;flex-direction:row;gap:12px;align-items:center}.park-native .eng-boss-wrap{width:90px;flex-shrink:0}.park-native .eng-boss{width:80px;height:80px}.park-native .eng-prompt{min-width:0}.park-native .eng-tools{display:flex;flex-wrap:wrap}.park-native .eng-tools button{flex:1;padding:10px}.park-native .zi-word{font-size:32px}.park-native .zi-stage .zi-pad-wrap{width:min(100%,40dvh)}.park-native .boss-page{grid-template-columns:1fr;padding:0}.park-native .park-monster-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.park-native .chest-row{gap:8px}.park-native .chest-card{padding:8px}.park-native .park-hanzi-cols .picker-svg{max-height:180px}.park-native .pad-svg{max-height:340px}}
@media(prefers-reduced-motion:reduce){.park-native *{animation:none!important;transition:none!important}}
.park-native .eng-stage{width:100%;box-sizing:border-box;min-width:0}
.park-native .eng-right{min-width:0;max-width:100%}
.park-native .eng-tools{width:100%;display:flex;gap:8px;flex-wrap:wrap}
.park-native .eng-tools .btn{min-width:90px;white-space:nowrap;flex:1;font-size:16px;line-height:1.5;padding:12px}
.park-native .eng-main{width:100%;min-width:0}
.park-native .park-hanzi-stage{box-sizing:border-box;max-width:1160px;margin:0 auto;padding:16px 24px;display:flex;flex-direction:column;gap:12px}
.park-native .park-hanzi-stage>.math-top{position:static;display:flex;gap:12px;margin:0;align-items:center;flex-shrink:0}
.park-native .park-hanzi-stage .math-progress{font-size:18px;flex:1}
.park-native .park-hanzi-stage .math-clock{font-size:28px;min-width:90px}
.park-native .park-hanzi-stage h2{margin:0 0 8px;font-size:22px}
.park-native .park-hanzi-stage .eng-feedback{margin:0;min-height:1.5em;line-height:1.5}
.park-native .park-hanzi-back{align-self:center}
.park-native .park-hanzi-stage .comp-chips{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.park-native .park-hanzi-stage .park-hanzi-cols section{display:flex;flex-direction:column;gap:8px}
.park-native .park-hanzi-stage .picker-svg,.park-native .park-hanzi-stage .pad-svg{box-sizing:border-box;display:block;aspect-ratio:1;align-self:center;width:min(100%,36dvh);height:36dvh;max-height:none;flex-shrink:0}
.park-native .park-hanzi-stage .row-gap{gap:8px}
@media (min-width:761px) and (orientation:landscape){
 .park-native .park-hanzi-stage{min-height:0;gap:8px;padding:12px 24px}
 .park-native .park-hanzi-stage .park-hanzi-cols{grid-template-columns:1fr 1.3fr;gap:24px}
 .park-native .park-hanzi-stage button{padding:8px 12px;font-size:16px;line-height:1.5}
 .park-native .park-hanzi-stage .comp-chips{margin:0}
}
@media(max-width:760px){.park-native .park-hanzi-stage{padding:16px}.park-native .park-hanzi-stage .picker-svg,.park-native .park-hanzi-stage .pad-svg{width:min(100%,300px);height:auto}}
.park-native .chest-card:disabled{opacity:1;color:var(--text)}

/* V8: the map attribution is readable without covering mobile movement controls. */
.neicheng-attribution{position:absolute;left:12px;top:100px;max-width:calc(100% - 24px);padding:5px 9px;border-radius:8px;background:#f4f1e6ed;color:#314b3d;font:12px/1.5 "Microsoft JhengHei",sans-serif;pointer-events:none;z-index:3}
.neicheng-loading{position:fixed;inset:0;z-index:140;display:grid;place-content:center;padding:24px;background:#eef1e5;color:#365b49;font:700 22px/1.7 "Microsoft JhengHei",sans-serif;text-align:center}
.neicheng-tour-hud{position:absolute;top:146px;left:16px;width:min(350px,calc(100% - 32px));box-sizing:border-box;padding:14px;border:1px solid #c5cdb6;border-radius:16px;background:#faf7ebf5;color:#304c3b;z-index:7;box-shadow:0 5px 22px #304c3b20;font-size:14px;line-height:1.55}
.neicheng-tour-hud[hidden]{display:none}.neicheng-tour-hud p{margin:6px 0}.neicheng-tour-status{font-weight:700;color:#6b5232}.neicheng-tour-actions{display:flex;flex-wrap:wrap;gap:6px}.neicheng-tour-hud button{min-height:44px;padding:8px 10px;font-size:14px}.neicheng-driver-speech{padding:8px 10px;margin:8px 0;background:#e7eddf;border-radius:10px}.neicheng-tour-hud small{display:block;margin-top:6px;font-size:12px}.neicheng-tour-board{padding:12px 0;border-top:1px solid #c5cdb6}.neicheng-tour-board ol{padding-left:22px}.neicheng-route-map{display:block;width:100%;max-height:280px;background:#ececdb;border:1px solid #c5cdb6;border-radius:12px}.neicheng-stamps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.neicheng-stamps article{display:flex;flex-direction:column;gap:8px;padding:14px 10px;border:2px dashed #aab5a1;border-radius:14px;color:#63705e;text-align:center}.neicheng-stamps .stamped{border:2px solid #638167;background:#e8efdc;color:#315d3d}.neicheng-passport .note{margin-top:16px}
@media(max-width:600px){.neicheng-tour-hud{top:143px;left:8px;width:calc(100% - 16px);padding:10px;font-size:13px}.neicheng-tour-hud small{font-size:11px}.neicheng-tour-hud .neicheng-tour-actions button{flex:1;white-space:nowrap;font-size:12px;padding:8px 4px}.neicheng-stamps{gap:8px}.neicheng-stamps article{padding:10px 8px}}
@media(max-width:600px){.neicheng-attribution{top:110px;left:8px;max-width:calc(100% - 16px);font-size:11px}.neicheng-loading{font-size:19px}}
.neicheng-tour-hud{top:auto;left:50%;bottom:calc(32px + env(safe-area-inset-bottom));transform:translateX(-50%);width:320px;max-width:calc(100% - 24px);padding:8px;background:var(--cream);z-index:7}
.neicheng-tour-hud [hidden]{display:none!important}
.neicheng-tour-hud .neicheng-tour-actions{display:grid;grid-template-columns:88px 112px 88px;gap:8px}
.neicheng-tour-hud .neicheng-tour-actions button{width:100%;height:56px;min-height:56px;padding:4px;font-size:14px;white-space:nowrap;touch-action:manipulation;transition:background .15s;transform:none}
.neicheng-cart-message{position:absolute;left:0;right:0;bottom:calc(100% + 10px);padding:12px 14px;background:var(--cream);border-radius:14px;box-shadow:0 5px 22px #304c3b20;max-height:155px;overflow:auto;font-size:13px;line-height:1.5}
.neicheng-cart-message p{margin:4px 0;line-height:1.5}.neicheng-cart-boarding{display:grid;gap:8px}
#toast{pointer-events:none}
.island-shell:has(#neichengTourHud[data-riding="true"]:not([hidden])) .goal{visibility:hidden}
.guide-button{position:absolute;right:104px;bottom:290px;z-index:4;background:var(--cream);min-height:56px}
.mobile-more-menu .guide-button{position:static}
.guide-options,.guide-destinations{display:grid;gap:10px}.guide-options button,.guide-destinations button{min-height:56px;text-align:left}
.guide-route-status{position:absolute;top:24px;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);padding:8px 12px;border-radius:16px;background:var(--cream);z-index:6;display:flex;align-items:center;gap:12px;font-size:14px;box-shadow:0 4px 18px #304c3b20}.guide-route-status[hidden]{display:none}.guide-route-status button{min-height:44px;padding:8px;white-space:nowrap}
.guide-bubble{position:absolute;left:50%;bottom:235px;transform:translateX(-50%);max-width:min(460px,calc(100% - 32px));background:var(--cream);z-index:6;font-size:14px;line-height:1.65;box-shadow:0 5px 22px #304c3b20;opacity:0;visibility:hidden;transition:opacity .2s,visibility 0s .2s;pointer-events:none}.guide-bubble.show{opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}.guide-bubble:active{transform:translateX(-50%)}
@media(max-width:700px){.neicheng-tour-hud{top:auto;left:50%;bottom:calc(205px + env(safe-area-inset-bottom));width:320px;padding:8px}.neicheng-tour-hud .neicheng-tour-actions button{font-size:14px;padding:4px;flex:none}.neicheng-cart-message{max-height:135px}.guide-route-status{top:170px;width:calc(100% - 24px);font-size:13px;gap:6px}.guide-bubble{bottom:285px;max-height:150px;overflow:auto}.guide-button{bottom:330px}}

/* 50-fix: navigation and speech occupy the upper safe area. */
#journeyNote{display:none!important}
.guide-route-status{top:94px;flex-wrap:wrap;justify-content:center;max-width:calc(100% - 24px);gap:8px}
.guide-route-status span{min-width:0;line-height:1.5}.guide-route-status [hidden]{display:none}
.guide-route-status button{font-size:13px;min-height:44px}
.guide-bubble{top:164px;bottom:auto;max-height:112px;overflow:auto}
.neicheng-cart-message{position:fixed;top:94px;bottom:auto;left:50%;right:auto;transform:translateX(-50%);width:320px;max-width:calc(100vw - 24px)}
@media(max-width:700px){.guide-route-status{top:214px;width:calc(100% - 24px);font-size:13px}.guide-bubble{top:320px;bottom:auto;max-height:100px}.neicheng-cart-message{top:214px;bottom:auto;max-height:135px}}
@media(prefers-reduced-motion:reduce){.guide-bubble{transition:none}}

/* Fixed speech panels must use the viewport, not a transformed HUD ancestor. */
.neicheng-tour-hud{left:max(12px,calc(50% - 160px));transform:none}
.neicheng-tour-hud[data-riding="false"]{height:0;padding:0;background:transparent;border:0;box-shadow:none}
.neicheng-cart-boarding{position:fixed;top:94px;left:50%;transform:translateX(-50%);width:320px;max-width:calc(100vw - 24px);padding:8px;border-radius:16px;background:var(--cream);box-shadow:0 5px 22px #304c3b20}
@media(max-width:700px){.neicheng-tour-hud{left:max(12px,calc(50% - 160px));transform:none}.neicheng-cart-boarding{top:214px}}
/* Quiet classroom goals stay above the joystick and bottom action row. */
.lesson-goals{position:absolute;top:154px;left:16px;z-index:12;width:240px;max-width:calc(100vw - 104px);padding:8px 12px;border:1px solid #c9c4b5;border-radius:12px;background:#fffdf4f5;color:#344d3c;font-size:14px;box-shadow:0 2px 8px #283a2020}
.lesson-goals summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:700}
.lesson-goals summary::after{content:'展開';margin-left:auto;font-size:11px;font-weight:500}.lesson-goals[open] summary::after{content:'收合'}
.lesson-goals ul{list-style:none;padding:0;margin:4px 0;line-height:1.8}
.lesson-goals p{font-size:12px;margin:6px 0}
.meal-menu .card{padding:12px}.meal-menu button{min-height:44px}.temple-result{padding:16px;background:#f3efe2;border-radius:12px}
.temple-wishes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0}.temple-wishes button{min-height:56px}
@media(max-width:600px){.lesson-goals{top:142px;width:206px;font-size:12px;max-height:calc(100dvh - 360px);overflow:auto}.lesson-goals summary{font-size:13px}.lesson-goals p{display:none}}
@media(max-height:500px){.lesson-goals{top:132px;width:220px;font-size:12px;max-height:calc(100dvh - 250px);overflow:auto}.lesson-goals p{display:none}}
/* Panorama stays above the scene controls and outside the movement/action areas. */
.panorama-button{position:absolute;right:18px;top:168px;z-index:32;min-height:44px;padding:10px 16px;border:1px solid #c7d6c8;border-radius:16px;background:#fff9ec;color:#284e3b;box-shadow:0 3px 12px #234b3520}
.panorama-active .touch-ui,.panorama-active .actions,.panorama-active .camera-controls,.panorama-active .world-prompts,.panorama-active .goal,.panorama-active .lesson-goals,.panorama-active .guide-hud,.panorama-active .menu-button,.panorama-active .side-menu,.panorama-active .guide-button,.panorama-active .guide-route-status{visibility:hidden;pointer-events:none}
.panorama-active .panorama-button{background:#285843;color:#fff9ec}
@media(max-width:600px){.panorama-button{top:180px;right:12px;font-size:14px}}
/* Keep the home editor reachable alongside the panorama control. */
.edit-home{top:168px;right:150px;min-height:44px;z-index:6}
@media(max-width:600px){.edit-home{top:236px;bottom:auto;right:12px}}

/* Task 58: beside the joystick, with a separate touch target. */
.vehicle-button{position:absolute;left:calc(24px * var(--ui));bottom:calc(240px * var(--ui));z-index:4;background:var(--cream);box-shadow:0 4px 14px #244a4126;min-width:88px;min-height:48px}
.vehicle-button[hidden]{display:none}.vehicle-icon{font-size:42px}.panorama-active .vehicle-button{visibility:hidden}
.work-tip-flight{position:fixed;z-index:100;pointer-events:none;border-radius:16px;padding:12px 18px;background:#fff2be;color:#38523f;font-weight:800;box-shadow:0 4px 16px #244a4133;animation:work-tip .85s ease-in-out forwards}
@keyframes work-tip{0%,20%{transform:translate(-50%,-50%);opacity:1}85%{opacity:1}100%{transform:translate(calc(var(--tip-x) - 50%),calc(var(--tip-y) - 50%)) scale(.5);opacity:0}}
@media(max-width:650px){.vehicle-button{left:16px;bottom:120px;min-height:48px;padding:10px 16px}}
@media(max-height:500px){.vehicle-button{left:8px;bottom:108px}}
@media(prefers-reduced-motion:reduce){.work-tip-flight{animation:none}}
/* Teacher board: lift a lock or give one child a new PIN. */
.board-person [data-board-person]{margin-left:8px;min-height:36px;padding:4px 10px;font-size:13px}
.account-admin{margin-top:18px;padding-top:14px;border-top:1px solid #d9d3c2}
.account-admin h3{margin:0 0 6px;font-size:16px}
.account-admin [data-admin-unlock]{margin:6px 0 4px}
/* V62 operation questions: a wide dialog with the drawing beside the question, so the
   confirm and continue buttons are on screen without scrolling past the drawing. */
#panel.quiz-panel{width:calc(100vw - 24px);max-width:1200px;max-height:calc(100dvh - 16px)}
#panel.quiz-panel #panelBody{max-height:calc(100dvh - 18px);padding:calc(14px * var(--ui)) calc(20px * var(--ui))}
.quiz-layout{display:grid;grid-template-columns:minmax(0,3fr) minmax(260px,2fr);grid-template-areas:"op top" "op side";grid-template-rows:auto 1fr;column-gap:calc(18px * var(--ui));row-gap:calc(6px * var(--ui));align-items:start}
.quiz-top{grid-area:top;min-width:0}.quiz-op{grid-area:op;min-width:0}.quiz-side{grid-area:side;display:grid;gap:calc(8px * var(--ui));min-width:0}
.quiz-layout .op-svg{max-height:calc(100dvh - 300px);min-height:180px}
.quiz-top>p{margin:0}.quiz-top .question{margin:calc(4px * var(--ui)) 0 0}
.quiz-side>p{margin:0}.quiz-side .feedback{margin-top:calc(4px * var(--ui))}
.quiz-side button.primary{min-height:48px}
@media (max-width:820px){.quiz-layout{grid-template-columns:1fr;grid-template-areas:"top" "op" "side";grid-template-rows:auto}.quiz-layout .op-svg{max-height:40dvh;min-height:0}}
@media (max-width:499px),(max-height:499px){#panel.quiz-panel{inset:0;margin:0;width:100%;max-width:100%;height:100dvh;max-height:100dvh;border-radius:0}#panel.quiz-panel #panelBody{max-height:100dvh}}
