/* 台灣地下城 v2・樣式（2026-10-22）
   既有產線調查：沿用 產出\台灣地下城_手機樣稿_v2重做_20261022.html 的 CSS（業主核准的樣稿，畫面照它做）；
   v1 的地圖＋右側欄版面整個拿掉。手機、PC 都是同一條 390px 直欄，PC 只是置中。
   動畫只用 CSS／DOM（不用 SVG、不用 PNG 動畫）；系統「減少動態」或設定關掉時一律停。 */
:root{
  --bg:#E4D7B8; --app:#F1E6CC; --paper:#FBF6EA; --ink:#2B2420; --ink2:#5A4E44;
  --line:#2B2420; --shadow:#2B2420; --muted:#DDD3BF; --dash:#C9BB9C;
  --red:#C8442F; --green:#3E6B48; --blue:#4F6F8F; --yellow:#F2D27A; --lgreen:#BFD8A8; --taro:#9C86B5;
  --on-red:#FBF6EA; --on-yellow:#2B2420; --good:#2F6B3A; --red-ink:#A8341F;
  --sky:#CFE0E8; --hill1:#7FA37A; --hill2:#3E6B48; --ground:#C9A77A; --path:#9C7F58;
  --sprite:#2B2420; --skin:#F6D3B0; --shirt:#FBF6EA;
  --veil:rgba(20,16,13,.62);
  --paper-2:#F1E6CC;   /* patrol.css 用 */
  --serif:"Noto Serif TC","Source Han Serif TC","PMingLiU",serif;
  --sans:"Noto Sans TC","Microsoft JhengHei",sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#14110F; --app:#1E1916; --paper:#2A231F; --ink:#F1E6CC; --ink2:#C9BBA3;
    --line:#7A6853; --shadow:#000; --muted:#3A322C; --dash:#4A3F36;
    --red:#C04A35; --green:#5E8C66; --blue:#6E8FAE; --yellow:#E2C066; --lgreen:#7FA06C; --taro:#8E7AA8; --good:#8FC79A; --red-ink:#F08A73;
    --sky:#34444F; --hill1:#4E6B4C; --hill2:#2F5038; --ground:#7A6449; --path:#5A4A36; --paper-2:#1E1916;
  }
}
:root[data-theme="dark"]{
  --bg:#14110F; --app:#1E1916; --paper:#2A231F; --ink:#F1E6CC; --ink2:#C9BBA3;
  --line:#7A6853; --shadow:#000; --muted:#3A322C; --dash:#4A3F36;
  --red:#C04A35; --green:#5E8C66; --blue:#6E8FAE; --yellow:#E2C066; --lgreen:#7FA06C; --taro:#8E7AA8; --good:#8FC79A; --red-ink:#F08A73;
  --sky:#34444F; --hill1:#4E6B4C; --hill2:#2F5038; --ground:#7A6449; --path:#5A4A36; --paper-2:#1E1916;
}
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after{animation:none!important;transition:none!important}
@media (prefers-reduced-motion: reduce){
  :root:not([data-motion="on"]) *, :root:not([data-motion="on"]) *::before, :root:not([data-motion="on"]) *::after{animation:none!important;transition:none!important}
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{background:var(--bg);color:var(--ink);font-family:var(--sans);font-size:13px;line-height:1.35}
body{min-height:100vh;min-height:100dvh;overflow-x:hidden}
button,input{font-family:var(--sans);color:var(--ink)}
button{cursor:pointer}
button:disabled{cursor:not-allowed}
.app{position:relative;max-width:390px;margin:0 auto;min-height:100vh;min-height:100dvh;background:var(--app);display:flex;flex-direction:column;border-left:2px solid var(--line);border-right:2px solid var(--line);overflow:hidden}
.screen{display:none;flex:1;flex-direction:column;gap:6px;padding:8px 10px 6px;min-height:0}
.screen.on{display:flex}
.card{background:var(--paper);border:2px solid var(--line);border-radius:10px;box-shadow:3px 3px 0 var(--shadow)}
h2{font-family:var(--serif);font-weight:900;font-size:17px}
.small{font-size:11px;color:var(--ink2)}
.tag{display:inline-flex;align-items:center;gap:3px;font-size:10px;font-weight:800;padding:0 6px 0 2px;border-radius:999px;border:1.5px solid var(--line);color:var(--on-yellow);white-space:nowrap}
.tag.danger{background:var(--yellow)} .tag.ok{background:var(--lgreen)} .tag.hot{background:var(--red);color:var(--on-red)} .tag.calm{background:var(--paper);color:var(--ink)}
.tag .ico.xs{border-width:1px;outline:none}
.hidden{display:none!important}

/* ---- icon：有 img/icon/<key>.webp 就用圖，沒有就是漢字佔位方塊（藍色虛線框） ---- */
.ico{width:26px;height:26px;flex:none;border-radius:7px;border:2px solid var(--sprite);display:inline-grid;place-items:center;font-family:var(--serif);font-weight:900;font-size:13px;color:#FBF6EA;outline:1px dashed var(--blue);outline-offset:1px;background:#5A4E44;line-height:1}
.ico.sm{width:18px;height:18px;font-size:10px;border-radius:5px;border-width:1.5px}
.ico.xs{width:14px;height:14px;font-size:8px;border-radius:4px}
.ico.lg{width:56px;height:56px;border-radius:14px;font-size:24px}
img.ico{background:none;outline:none;border:none;object-fit:contain}
.i-hp{background:#C8442F} .i-stamina{background:#3E6B48} .i-fuel,.i-gas{background:#4F6F8F} .i-gold{background:#F2D27A;color:#2B2420}
.i-foodbag{background:#6F5A8C} .i-power{background:#5A4E44} .i-exp{background:#3E6B48} .i-material{background:#7E5530} .i-party,.i-teambonus{background:#5A4E44}
.i-restore{background:#C8442F} .i-pin{background:#3E6B48} .i-danger{background:#C8442F} .i-level{background:#2B2420} .i-lock{background:#5A4E44}
.i-time{background:#4F6F8F} .i-settings{background:#5A4E44}

/* 按鈕：觸控目標至少 44px */
.btn{font-weight:900;font-size:16px;border:2px solid var(--line);border-radius:10px;box-shadow:3px 3px 0 var(--shadow);background:var(--red);color:var(--on-red);min-height:48px;width:100%;padding:0 10px}
.btn:active{transform:translate(2px,2px);box-shadow:1px 1px 0 var(--shadow)}
.btn.sub{background:var(--paper);color:var(--ink);font-size:14px;min-height:44px}
.btn:disabled{background:var(--muted);color:var(--ink2);border-style:dashed;box-shadow:none}
.btn:focus-visible,.opt:focus-visible,.mode:focus-visible,.tabs button:focus-visible,.iconbtn:focus-visible,.price:focus-visible,.chip-btn:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
.iconbtn{width:44px;height:44px;flex:none;border:2px solid var(--line);border-radius:10px;background:var(--paper);display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:10px;font-weight:800;gap:1px}
.chip-btn{min-height:44px;border:2px solid var(--line);border-radius:999px;background:var(--paper);font-weight:800;font-size:13px;padding:0 12px}
.chip-btn.sel{background:var(--ink);color:var(--paper)}
#harvestBtn,#s-move > .go,#s-gear > .pick,#s-harvest > .ask{margin-top:auto}

/* ---- 勇者列 ---- */
.hero-bar{display:flex;align-items:center;gap:8px;padding:5px 6px 5px 8px}
.ava{width:40px;height:40px;border-radius:50%;background:#F2D27A;border:2px solid var(--sprite);position:relative;flex:none;overflow:hidden}
.ava::before{content:"";position:absolute;left:8px;top:12px;width:21px;height:21px;border-radius:50%;background:var(--skin);border:2px solid var(--sprite)}
.ava::after{content:"";position:absolute;left:5px;top:5px;width:27px;height:11px;border-radius:12px 12px 2px 2px;background:#C8442F;border:2px solid var(--sprite)}
.who{flex:1;min-width:0}
.who .nm{font-family:var(--serif);font-weight:900;font-size:16px;display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.lv{font-family:var(--sans);font-weight:800;font-size:11px;background:var(--ink);color:var(--paper);border-radius:4px;padding:0 5px}
.title-chip{font-family:var(--sans);background:var(--red);color:var(--on-red);font-weight:800;font-size:11px;padding:0 7px;border-radius:999px;border:1.5px solid var(--line)}
.title-chip.hid{background:var(--yellow);color:var(--on-yellow)}
.exp{height:6px;border:1.5px solid var(--line);border-radius:4px;background:var(--muted);margin-top:4px;overflow:hidden}
.exp i{display:block;height:100%;background:var(--green)}

/* ---- 掛機狀態卡 ---- */
.idle{padding:7px 9px;display:flex;flex-direction:column;gap:4px}
.idle .loc{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.idle .loc button{background:none;border:none;font-family:var(--serif);font-size:15px;font-weight:900;text-decoration:underline dotted;text-underline-offset:3px;padding:0 2px;min-height:44px;margin:-11px 0;color:var(--ink)}
.idle .loc .tags{display:flex;gap:4px;margin-left:auto}
.idle .row{display:flex;justify-content:space-between;align-items:baseline}
.idle .time{font-family:var(--serif);font-weight:900;font-size:24px;line-height:1}
.bar{height:12px;border:2px solid var(--line);border-radius:7px;background:var(--muted);overflow:hidden}
.bar i{display:block;height:100%;background:var(--yellow);border-right:2px solid var(--line)}
.bar.move i{background:var(--lgreen)}
.gains{display:flex;gap:8px;font-size:12px;font-weight:700;flex-wrap:wrap}
.gains span{display:flex;align-items:center;gap:3px}
.gains em{font-style:normal;color:var(--good);font-weight:900}
.doing{font-size:11px;color:var(--ink2)}

/* ---- 即時小戰鬥 ---- */
.stage{position:relative;height:250px;flex:none;overflow:hidden;border-radius:10px;border:2px solid var(--line);background:var(--sky);box-shadow:3px 3px 0 var(--shadow)}
.stage .hill1{position:absolute;left:-30px;bottom:52px;width:220px;height:90px;border-radius:50% 50% 0 0;background:var(--hill1);border:2px solid var(--sprite)}
.stage .hill2{position:absolute;right:-40px;bottom:52px;width:260px;height:110px;border-radius:50% 50% 0 0;background:var(--hill2);border:2px solid var(--sprite)}
.stage .lantern{position:absolute;top:16px;width:14px;height:18px;border-radius:6px;background:#C8442F;border:2px solid var(--sprite);animation:sway 2.4s ease-in-out infinite}
.stage .lantern::before{content:"";position:absolute;left:4px;top:-18px;width:2px;height:16px;background:var(--sprite)}
.stage .ground{position:absolute;left:0;right:0;bottom:0;height:54px;background:var(--ground);border-top:2px solid var(--sprite)}
.stage .steps{position:absolute;left:0;right:0;bottom:30px;height:0;border-top:3px dashed var(--path)}
.stage.walking .ground,.stage.walking .steps{animation:scroll 1.2s linear infinite}
@keyframes scroll{from{background-position:0 0;transform:translateX(0)}to{transform:translateX(-24px)}}
@keyframes sway{0%,100%{transform:rotate(-6deg)}50%{transform:rotate(6deg)}}
.hero{position:absolute;left:70px;bottom:40px;width:44px;height:78px;animation:lunge 1.2s ease-in-out infinite}
.stage.walking .hero{animation:bob .6s ease-in-out infinite}
@keyframes bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
.hero .head{position:absolute;left:8px;top:0;width:28px;height:28px;border-radius:50%;background:var(--skin);border:2px solid var(--sprite)}
.hero .cap{position:absolute;left:5px;top:-3px;width:32px;height:13px;border-radius:14px 14px 3px 3px;background:#C8442F;border:2px solid var(--sprite)}
.hero .eye{position:absolute;top:13px;width:5px;height:7px;border-radius:50%;background:var(--sprite)}
.hero .body{position:absolute;left:9px;top:27px;width:26px;height:26px;border-radius:6px;background:var(--shirt);border:2px solid var(--sprite)}
.hero.mail .body{background:#9AA3A8} .hero.raincoat .body{background:#E2C066}
.hero .legL,.hero .legR{position:absolute;top:51px;width:9px;height:22px;background:var(--sprite);border-radius:3px}
.hero .legL{left:11px} .hero .legR{left:24px}
.hero .shoe{position:absolute;top:70px;width:14px;height:7px;background:var(--shirt);border:2px solid var(--sprite);border-radius:5px}
.weapon{position:absolute;left:34px;top:18px;transform-origin:2px 20px;animation:swing 1.2s ease-in-out infinite}
.weapon.sword{width:6px;height:40px;background:#D9DDE0;border:2px solid var(--sprite);border-radius:3px 3px 1px 1px;top:-4px}
.weapon.sword::after{content:"";position:absolute;left:-7px;top:26px;width:16px;height:5px;background:#F2D27A;border:2px solid var(--sprite)}
.weapon.spear{width:5px;height:62px;background:#A87A4A;border:2px solid var(--sprite);top:-22px}
.weapon.spear::after{content:"";position:absolute;left:-5px;top:-12px;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:14px solid var(--sprite)}
.weapon.bow{width:18px;height:46px;border:3px solid #A87A4A;border-left:none;border-radius:0 30px 30px 0;top:-6px}
.weapon.staff{width:6px;height:56px;background:#7A5634;border:2px solid var(--sprite);top:-16px}
.weapon.staff::after{content:"";position:absolute;left:-7px;top:-12px;width:16px;height:16px;border-radius:50%;background:#4F6F8F;border:2px solid var(--sprite)}
.weapon.fist{width:18px;height:16px;background:#C8442F;border:2px solid var(--sprite);border-radius:6px;top:22px;left:32px}
.weapon.gun{width:30px;height:9px;background:#5A4E44;border:2px solid var(--sprite);border-radius:2px;top:30px;left:30px}
.weapon.gun::after{content:"";position:absolute;left:2px;top:6px;width:7px;height:10px;background:#7A5634;border:2px solid var(--sprite)}
@keyframes lunge{0%,55%,100%{transform:translateX(0)}70%{transform:translateX(34px)}}
@keyframes swing{0%,55%,100%{transform:rotate(-20deg)}70%{transform:rotate(70deg)}}
.mon{position:absolute;right:66px;bottom:42px;width:64px;height:56px;animation:hurt 1.2s linear infinite}
/* 已定案的怪物／美食怪圖是不透明的奶油底（RGB），所以做成一張小卡：加框、圓角、硬陰影，看起來是刻意的 */
.mon img{position:absolute;left:-6px;bottom:-2px;width:76px;height:76px;object-fit:contain;background:#F8F4EC;border:2px solid var(--sprite);border-radius:12px;box-shadow:3px 3px 0 var(--sprite)}
.mon .blob{position:absolute;inset:0;border-radius:50% 50% 42% 42%;background:#9C86B5;border:2px solid var(--sprite)}
.mon .blob::before{content:"";position:absolute;left:8px;top:6px;width:16px;height:12px;border-radius:50%;background:#F2D27A;border:2px solid var(--sprite)}
.mon .blob::after{content:"";position:absolute;right:6px;top:14px;width:13px;height:11px;border-radius:50%;background:#FBF6EA;border:2px solid var(--sprite)}
.mon .e{position:absolute;top:22px;width:12px;height:14px;border-radius:50%;background:#FBF6EA;border:2px solid var(--sprite)}
.mon .e::after{content:"";position:absolute;left:3px;top:4px;width:4px;height:5px;border-radius:50%;background:var(--sprite)}
.mon .m{position:absolute;left:24px;top:40px;width:14px;height:7px;border-radius:0 0 8px 8px;background:var(--sprite)}
.stage.walking .mon,.stage.walking .mname,.stage.walking .monhp{display:none}
@keyframes hurt{0%,66%,100%{transform:translateX(0)}70%{transform:translateX(7px) rotate(4deg)}76%{transform:translateX(-3px)}}
.hpbar{position:absolute;height:6px;border:1.5px solid var(--sprite);background:#FBF6EA;border-radius:3px;overflow:hidden}
.hpbar i{display:block;height:100%;background:#C8442F;transition:width .3s}
.dmg{position:absolute;font-family:var(--serif);font-weight:900;font-size:20px;color:#FBF6EA;-webkit-text-stroke:1.5px #2B2420;paint-order:stroke;animation:rise .9s ease-out forwards;pointer-events:none}
.dmg.crit{color:#F2D27A;font-size:24px}
.dmg.skill{color:#BFD8A8;font-size:13px;-webkit-text-stroke:1px #2B2420}
@keyframes rise{0%{transform:translateY(0);opacity:1}100%{transform:translateY(-38px);opacity:0}}
.chip{position:absolute;background:#FBF6EA;color:#2B2420;border:2px solid #2B2420;border-radius:8px;padding:2px 7px;font-weight:800;font-size:11px}
.stage .mname{right:48px;bottom:116px;border-width:1.5px;padding:0 5px;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stage .counter{left:8px;top:8px;font-size:12px}
.stage .counter b{font-family:var(--serif);font-size:16px;color:#C8442F}
.stage .drop{right:8px;top:8px;background:#F2D27A;max-width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stage .roadsign{left:8px;bottom:62px;background:#3E6B48;color:#FBF6EA;display:none}
.stage.walking .roadsign{display:block}

/* ---- 狀態 6 格 ---- */
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}
.st{display:flex;align-items:center;gap:6px;padding:4px 6px;background:var(--paper);border:2px solid var(--line);border-radius:8px;min-height:44px;text-align:left;font:inherit;color:inherit}
button.st{cursor:pointer}
.st .v{font-weight:800;font-size:13px;line-height:1.1}
.st .l{font-size:10px;color:var(--ink2);line-height:1.15}
.mini{height:4px;border-radius:3px;background:var(--muted);margin-top:2px;overflow:hidden;width:58px}
.mini i{display:block;height:100%}

.feed{padding:4px 8px;font-size:12px;list-style:none}
.feed li{display:flex;gap:6px;line-height:1.5;align-items:center;white-space:nowrap;overflow:hidden}
.feed li span.tm{color:var(--ink2);font-size:11px;flex:none;width:34px}
.feed li .tx{overflow:hidden;text-overflow:ellipsis}

/* ---- 提示／錯誤狀態 ---- */
.err{display:none;align-items:center;gap:8px;padding:6px 8px;background:var(--paper);border:2px solid var(--red);border-radius:10px;box-shadow:3px 3px 0 var(--shadow)}
.err.on{display:flex}
.err.info{border-color:var(--blue)}
.err .t{flex:1;font-size:12px}
.err .t b{color:var(--red-ink)}
.err.info .t b{color:var(--blue)}
.err .btn{width:78px;font-size:13px;flex:none}

/* ---- 底部分頁 ---- */
.tabs{display:grid;grid-template-columns:repeat(5,1fr);border-top:2px solid var(--line);background:var(--paper);padding:4px 4px 6px;flex:none}
.tabs button{background:none;border:none;font-size:11px;font-weight:700;color:var(--ink2);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:50px;border-radius:8px}
.tabs .ti{width:30px;height:24px;border-radius:7px;border:2px solid var(--line);background:var(--app);display:grid;place-items:center;font-family:var(--serif);font-weight:900;font-size:12px;color:var(--ink);outline:1px dashed var(--blue);outline-offset:1px}
.tabs img.ti{outline:none;border:none;background:none;object-fit:contain}
.tabs button.on{color:var(--ink);font-weight:900}
.tabs button.on .ti{background:var(--red);color:var(--on-red)}
.tabs.hide{display:none}

/* ---- 移動 ---- */
.netmap{padding:7px 8px 6px}
.netmap .hd{display:flex;align-items:center;gap:6px}
.netmap .hd h2{flex:1;font-size:15px}
.netmap .nav{width:44px;height:44px;border:2px solid var(--line);border-radius:10px;background:var(--paper);font-weight:900;font-size:16px}
.npc{width:40px;height:40px;border-radius:50%;border:2px solid var(--line);background:var(--yellow);overflow:hidden;flex:none}
.npc img{width:100%;height:100%;object-fit:cover;object-position:top}
.line{position:relative;height:50px;margin:2px 4px 0}
.line .rail{position:absolute;left:8px;right:8px;top:18px;height:6px;border:1.5px solid var(--line);border-radius:3px;display:flex;overflow:hidden;background:var(--muted)}
.line .rail i{flex:1;border-right:1.5px solid var(--line)}
.line .rail i:last-child{border-right:none}
.seg-ok{background:var(--green)} .seg-part{background:var(--yellow)} .seg-lock{background:var(--muted)} .seg-stop{background:repeating-linear-gradient(45deg,var(--red) 0 4px,var(--paper) 4px 8px)}
.line .st2{position:absolute;top:11px;width:18px;height:18px;border-radius:50%;background:var(--paper);border:2px solid var(--line);transform:translateX(-50%)}
.line .st2.here{background:var(--red)}
.line .lb{position:absolute;top:31px;font-size:10px;font-weight:700;transform:translateX(-50%);white-space:nowrap}
.line .lb.here{font-weight:900;color:var(--red-ink)}
.pairs{display:grid;grid-template-columns:1fr 1fr;gap:3px 10px;font-size:11px;margin:4px 2px}
.pairs span{display:flex;align-items:center;gap:4px}
.pairs i{width:24px;height:6px;border:1.5px solid var(--line);border-radius:3px;flex:none}
.legend{display:flex;gap:10px;font-size:10px;margin-top:2px;flex-wrap:wrap}
.legend span::before{content:"";display:inline-block;width:12px;height:6px;border:1.5px solid var(--line);margin-right:3px;vertical-align:1px}
.legend .a::before{background:var(--green)} .legend .b::before{background:var(--yellow)} .legend .c::before{background:var(--muted)} .legend .d::before{background:repeating-linear-gradient(45deg,var(--red) 0 3px,var(--paper) 3px 6px)}
.pushrow{display:flex;align-items:center;gap:6px;font-size:11px;margin-top:4px}
.pushrow .t{flex:1}
.pushrow .chip-btn{min-height:44px;font-size:12px;padding:0 10px}
.dest{padding:5px 8px;display:flex;flex-direction:column;gap:4px}
.dest .hd{display:flex;justify-content:space-between;align-items:center;gap:6px}
.dest .hd b{font-family:var(--serif);font-weight:900;font-size:14px}
.modes{display:grid;grid-template-columns:repeat(5,1fr);gap:4px}
.modes.sea{grid-template-columns:repeat(2,1fr)}
.mode{border:2px solid var(--line);border-radius:8px;background:var(--paper);padding:3px 2px;text-align:center;font-size:10px;line-height:1.25;min-height:52px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--ink)}
.mode .mi{display:block;margin:0 auto 1px;width:22px;height:18px;border-radius:5px;border:1.5px solid var(--line);font-family:var(--serif);font-weight:900;font-size:11px;line-height:15px;background:var(--app);outline:1px dashed var(--blue);outline-offset:1px}
.mode img.mi{outline:none;border:none;background:none}
.mode b{display:block;font-size:12px}
.mode.sel{background:var(--yellow);color:var(--on-yellow)}
.mode.sel .mi{background:#FBF6EA;color:#2B2420;border-color:#2B2420}
.mode.lock{background:var(--muted);color:var(--ink2);border-style:dashed}
.mode.none{opacity:.55}
.why{font-size:11px;background:var(--app);border:1.5px dashed var(--line);border-radius:6px;padding:3px 6px}
.dests{display:flex;flex-direction:column;gap:6px}

/* ---- 裝備 ---- */
.gear-top{display:flex;gap:8px;padding:8px}
.preview{position:relative;width:96px;height:112px;flex:none;border:2px solid var(--line);border-radius:8px;background:var(--sky);overflow:hidden}
.preview .ground{position:absolute;left:0;right:0;bottom:0;height:22px;background:var(--ground);border-top:2px solid var(--sprite)}
.preview .hero{left:22px;bottom:14px;animation:none}
.preview .weapon{animation:none;transform:rotate(-20deg)}
.ttl{flex:1;display:flex;flex-direction:column;gap:3px;min-width:0}
.ttl .big{font-family:var(--serif);font-weight:900;font-size:20px;color:var(--red-ink);line-height:1.15}
.ttl .flash{animation:flash .5s}
@keyframes flash{0%{background:var(--yellow)}100%{background:transparent}}
.skills{display:flex;flex-direction:column;gap:3px;padding:6px 8px}
.sk{display:flex;gap:6px;align-items:flex-start;font-size:12px}
.sk .k{flex:none;font-size:10px;font-weight:900;border:1.5px solid var(--line);border-radius:4px;padding:0 4px;background:var(--lgreen);color:var(--on-yellow)}
.sk .k.act{background:var(--red);color:var(--on-red)} .sk .k.sp{background:var(--yellow)} .sk .k.none{background:var(--muted);color:var(--ink2)}
.pick{padding:6px 8px;display:flex;flex-direction:column;gap:4px}
.pick .lab{font-size:11px;font-weight:900;display:flex;justify-content:space-between}
.opts{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}
.opt{border:2px solid var(--line);border-radius:8px;background:var(--paper);min-height:44px;font-size:12px;font-weight:800;line-height:1.15;padding:2px 3px;display:flex;align-items:center;justify-content:center;gap:4px;color:var(--ink)}
.opt.sel{background:var(--ink);color:var(--paper)}
.opt small{font-size:10px;font-weight:700;opacity:.85}

/* ---- 收成結果 ---- */
.res{padding:8px 10px;display:flex;flex-direction:column;gap:6px}
.res .big{font-family:var(--serif);font-weight:900;font-size:22px}
.loot{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}
.loot > div{border:2px solid var(--line);border-radius:8px;background:var(--paper);padding:4px 6px;display:flex;gap:5px;align-items:center;min-width:0}
.loot b{font-size:15px;font-weight:900;display:block;line-height:1.1}
.loot .small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.log{font-size:12px;line-height:1.55;padding:6px 10px;border-left:4px solid var(--red)}
.next{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.hint{font-size:11px;background:var(--yellow);color:var(--on-yellow);border:1.5px solid var(--line);border-radius:6px;padding:3px 7px}

/* ---- 商店／組隊 ---- */
.shophd{padding:6px 8px;display:flex;align-items:center;gap:8px}
.shophd .t{flex:1}
.seg3{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}
.list{padding:0 8px}
.list .it,.mate{display:flex;align-items:center;gap:8px;padding:2px 0;border-bottom:1.5px dashed var(--dash);min-height:47px}
.list .it:last-child,.mate:last-child{border-bottom:none}
.list .it .n{flex:1;min-width:0;line-height:1.25}
.list .it .n b{font-weight:900}
.list .it .n .small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.price{font-weight:900;border:2px solid var(--line);border-radius:8px;padding:0 8px;background:var(--yellow);color:var(--on-yellow);min-height:44px;min-width:76px;font-size:13px;flex:none}
.price:disabled{background:var(--muted);color:var(--ink2);border-style:dashed}
.price.owned{background:var(--paper);color:var(--ink)}
.mate .ava{width:32px;height:32px}
.mate .ava::before{left:6px;top:9px;width:16px;height:16px}
.mate .ava::after{left:4px;top:4px;width:22px;height:9px}
.code{font-family:var(--serif);font-weight:900;font-size:22px;letter-spacing:.2em}
.empty{padding:14px 12px;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}
.empty input,.start input,.sheet input{width:100%;min-height:48px;border:2px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);font-size:18px;font-weight:800;padding:0 12px;letter-spacing:.1em}
.raid{padding:8px;display:flex;flex-direction:column;gap:6px}
.raid .hd{display:flex;gap:8px;align-items:center}

/* ---- 首次建角 ---- */
.start{justify-content:center;gap:12px;padding:20px 18px}
.start .logo{font-family:var(--serif);font-weight:900;font-size:34px;line-height:1.1}
.start .logo span{color:var(--red-ink)}
.start p{font-size:14px;line-height:1.6}
.start label{font-weight:900;font-size:14px}
.start .note{font-size:12px;color:var(--ink2)}
.start .err{margin-top:4px}

/* ---- 全畫面狀態（維護、斷線） ---- */
.full{justify-content:center;align-items:center;text-align:center;gap:12px;padding:24px 20px}
.full p{font-size:14px;line-height:1.6}

/* ---- 首次引導 ---- */
.coach{display:none;position:absolute;inset:0;z-index:20}
.coach.on{display:block}
.coach .spot{position:absolute;border-radius:12px;box-shadow:0 0 0 2000px var(--veil);outline:3px solid #F2D27A;outline-offset:2px;pointer-events:none}
.coach .tip{position:absolute;left:14px;right:14px;background:#FBF6EA;color:#2B2420;border:2px solid #2B2420;border-radius:12px;box-shadow:3px 3px 0 #000;padding:10px 12px;display:flex;flex-direction:column;gap:8px}
.coach .tip h3{font-family:var(--serif);font-weight:900;font-size:17px}
.coach .tip p{font-size:13px;line-height:1.55}
.coach .tip .row{display:flex;gap:8px;align-items:center}
.coach .tip .step{font-size:12px;font-weight:800;color:#5A4E44;flex:1}
.coach .tip .btn{width:auto;padding:0 18px;font-size:14px;color:#FBF6EA;border-color:#2B2420;box-shadow:3px 3px 0 #2B2420}
.coach .tip .btn.sub{background:#FBF6EA;color:#2B2420}

/* ---- 底部面板（設定、美食背包、景點、陣營、打造…） ---- */
.sheet{display:none;position:absolute;left:0;right:0;bottom:0;z-index:15;background:var(--paper);border-top:2px solid var(--line);border-radius:16px 16px 0 0;box-shadow:0 -3px 0 var(--shadow);padding:12px 14px 16px;flex-direction:column;gap:8px;max-height:88%;overflow-y:auto;overscroll-behavior:contain}
.sheet.on{display:flex}
.sheet .seg{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}
.sheet .seg.two{grid-template-columns:repeat(2,1fr)}
.sheet .lab{font-weight:900;font-size:13px}
.sheet .row{display:flex;gap:6px;align-items:center}
.veil{display:none;position:absolute;inset:0;z-index:14;background:var(--veil)}
.veil.on{display:block}
.food-it{display:flex;gap:8px;align-items:center;padding:4px 0;border-bottom:1.5px dashed var(--dash)}
.food-it img{width:44px;height:44px;object-fit:contain;flex:none}
.food-it .n{flex:1;min-width:0;font-size:12px;line-height:1.3}
.food-it .acts{display:flex;flex-direction:column;gap:4px}
.food-it .acts .price{min-width:64px;min-height:44px;font-size:12px}
.fac{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.fac button{min-height:56px;border:2px solid var(--line);border-radius:10px;background:var(--paper);text-align:left;padding:4px 8px;font-size:11px;line-height:1.3}
.fac button b{font-size:14px;display:block}

/* ---- 景點詳情的掃街地圖：patrol.css 沿用 v1 變數名（--card、--muted 當字色），這裡補 v2 對應＋觸控 44px ---- */
.sheet .patrol{--card:var(--paper);height:200px;margin:4px 0;flex:none}
.sheet .patrol .pz-hint{min-height:44px;padding:0 10px;color:var(--ink);background:var(--paper);font-weight:800;border-radius:8px;border:2px solid var(--line)}
.sheet .patrol .pz-attr{color:var(--ink);display:flex;align-items:center;min-height:44px;padding:0 4px}
.sheet .patrol .pz-attr a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;padding:0 4px}

/* ---- 提示泡泡 ---- */
.toast{position:absolute;left:50%;bottom:86px;width:max-content;transform:translateX(-50%) translateY(20px);background:var(--ink);color:var(--paper);padding:8px 14px;border-radius:10px;font-weight:700;font-size:13px;opacity:0;transition:opacity .2s,transform .2s;z-index:30;max-width:92%;pointer-events:none;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* =====================================================================
   8-bit 像素＋積木玩具風（業主 10-22：「美術要做成 8BIT 感＋樂高」）
   上面是樣稿的版面與色彩變數（深色、對比都量過），這一段只改「長相」：
   方角、硬邊陰影、像素字（英數字 Press Start 2P；中文系統黑體加粗）、按鈕頂端積木凸點、逐格動畫 steps()、圖片 pixelated。
   ⚠ 版權：只用通用「積木方塊人」造型；不出現任何品牌字樣或照抄品牌人偶（圓柱頭、C 形手那種不做）。
   ===================================================================== */
:root{
  --serif:"Microsoft JhengHei","PingFang TC","Noto Sans TC",sans-serif;   /* 標題：中文系統黑體加粗，不用圓潤字 */
  --sans:"Microsoft JhengHei","PingFang TC","Noto Sans TC",sans-serif;
  --pixel:"Press Start 2P","Microsoft JhengHei","PingFang TC",monospace;  /* 英數字像素字；中文字會自動退回後面的黑體 */
  --stud:var(--red);
}
.app *{border-radius:0!important}                                   /* 方塊化 */
.app .btn,.app .opt,.app .mode,.app .price,.app .chip-btn,.app .iconbtn,.app .st,.app .tag{border-radius:2px!important}
h2,.who .nm,.idle .loc b,.idle .loc button,.dest .hd b,.res .big,.ttl .big,.coach .tip h3,.start .logo{font-weight:900;letter-spacing:.02em}
.card,.stage,.err,.st,.loot > div,.opt,.mode,.price,.iconbtn{box-shadow:4px 4px 0 var(--shadow)}
.card,.stage{border-width:3px}
img,.ico,.npc img,.mon img{image-rendering:pixelated}
/* 數字用像素字（字比較寬，字級縮一點） */
.idle .time{font-family:var(--pixel);font-size:18px;line-height:1.2}
.lv,.st .v,.loot b,.price,.code,.stage .counter b,.mode b,.gains em,#gPow{font-family:var(--pixel);letter-spacing:0}
.lv{font-size:9px;padding:2px 4px}
.st .v{font-size:10px;line-height:1.5}
.loot b{font-size:12px;line-height:1.5}
.price{font-size:10px}
.code{font-size:16px;letter-spacing:.15em}
.mode b{font-size:9px;line-height:1.6}
.gains em{font-size:10px}
.stage .counter b{font-size:13px}
.dmg{font-family:var(--pixel);font-size:14px;-webkit-text-stroke:0;text-shadow:2px 2px 0 #2B2420,-2px 0 0 #2B2420,0 -2px 0 #2B2420}
.dmg.crit{font-size:18px}
/* 進度條：一格一格的像素條 */
.bar i{background:repeating-linear-gradient(90deg,var(--yellow) 0 10px,transparent 10px 12px)}
.bar.move i{background:repeating-linear-gradient(90deg,var(--lgreen) 0 10px,transparent 10px 12px)}
.exp i,.mini i{background-image:repeating-linear-gradient(90deg,transparent 0 6px,rgba(0,0,0,.25) 6px 7px)}
/* 積木凸點：按鈕頂端一排小方塊（顏色跟按鈕一樣、外框深色） */
.btn,.price{position:relative}
.btn::before,.price::before{content:"";position:absolute;left:10px;right:10px;top:-7px;height:5px;pointer-events:none;
  background:repeating-linear-gradient(90deg,var(--stud) 0 10px,transparent 10px 22px);
  filter:drop-shadow(2px 0 0 var(--line)) drop-shadow(-2px 0 0 var(--line)) drop-shadow(0 -2px 0 var(--line))}
.btn.sub{--stud:var(--paper)} .price{--stud:var(--yellow)} .price.owned{--stud:var(--paper)}
.btn:disabled::before,.price:disabled::before{display:none}
.coach .tip .btn::before{display:none}
/* 積木方塊人：方頭、方身、方腳（通用造型），頭頂髮塊 */
.hero .head{width:26px;height:24px;left:9px;top:2px}
.hero .cap{height:9px;top:-1px;left:7px;width:30px}
.hero .eye{width:4px;height:4px;top:11px}
.ava::before{border-radius:0}
/* 動畫改逐格（steps）：8-bit 感 */
.hero,.weapon{animation-timing-function:steps(4,end)}
.mon{animation-timing-function:steps(3,end)}
.stage .lantern{animation-timing-function:steps(2,end)}
.stage.walking .hero{animation-timing-function:steps(2,end)}
.stage.walking .ground,.stage.walking .steps{animation-timing-function:steps(4,end)}
.dmg{animation-timing-function:steps(5,end)}
.ttl .flash{animation-timing-function:steps(3,end)}
/* 地面像素格 */
.stage .ground{background-image:repeating-linear-gradient(90deg,transparent 0 14px,rgba(0,0,0,.12) 14px 16px)}
.stage .hill1,.stage .hill2{border-radius:0!important;clip-path:polygon(0 100%,0 40%,15% 40%,15% 20%,35% 20%,35% 0,65% 0,65% 20%,85% 20%,85% 40%,100% 40%,100% 100%)}
/* （v3：.stage 側面揮劍戰鬥已從主畫面拿掉；上面 .stage／.hero／.mon 規則留給裝備頁預覽的方塊人用 .hero，其餘沒有元素會套到） */

/* =====================================================================
   v3（2026-10-22 業主退件）：巡邏地圖當主角、這區人數、戰績頁、路網圖、技能搭配、補給站、登入
   ===================================================================== */
/* ---- 主畫面巡邏地圖 ---- */
.mapcard{position:relative;flex:1 1 224px;min-height:224px;   /* 錯誤框出現時讓地圖縮到 224，主畫面才不會超出一屏（第二輪實量 869→844） */overflow:hidden;padding:0}   /* 主角：把主畫面剩下的高度都吃掉 */
.mapcard .pz-face{transform:scale(1.35);transform-origin:50% 100%}
.mapcard .patrol.face-left .pz-face{transform:scale(-1.35,1.35)}
.mapslot{position:absolute;inset:0}
.mapslot .patrol{--card:var(--paper);margin:0;height:100%;border:none;box-shadow:none}
.mapcard .pz-cap{display:none}
.mapcard .pz-hint{min-height:44px;padding:0 10px;color:var(--ink);background:var(--paper);font-weight:800;border:2px solid var(--line)}
.mapcard .pz-attr{color:var(--ink);display:flex;align-items:center;min-height:44px;padding:0 4px;font-size:10px}
.mapcard .pz-attr a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;padding:0 2px}
.maploc,.mapcount{position:absolute;top:6px;z-index:900;display:flex;align-items:center;gap:5px;min-height:44px;padding:2px 8px;background:var(--paper);color:var(--ink);border:2px solid var(--line);box-shadow:3px 3px 0 var(--shadow);text-align:left;max-width:58%}
.maploc{left:6px}
.mapcount{right:6px;max-width:40%}
.maploc span,.mapcount span{display:flex;flex-direction:column;line-height:1.2;min-width:0}
.maploc b{font-size:14px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mapcount b{font-size:12px;font-weight:900;white-space:nowrap}
.maploc small,.mapcount small{font-size:10px;color:var(--ink2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.movebanner{display:none;position:absolute;left:6px;right:6px;top:58px;z-index:900;align-items:center;gap:6px;padding:4px 8px;background:var(--lgreen);color:#2B2420;border:2px solid var(--line);font-weight:800;font-size:12px}
.movebanner.on{display:flex}
.movebanner small{font-weight:700}
.idle .loc{flex-wrap:nowrap;align-items:center}
.idle .loc .tags{margin-left:0;flex:1;min-width:0;flex-wrap:wrap;row-gap:3px}
.idle .loc .dexbtn{flex:none}
.idle .loc .dexbtn{margin:0 0 0 auto;min-height:44px;padding:0 8px;text-decoration:none;font-family:var(--sans);background:var(--yellow);color:var(--on-yellow);border:2px solid var(--line);font-weight:800;font-size:12px;box-shadow:2px 2px 0 var(--shadow)}
.dexbtn b{font-family:var(--pixel);font-size:10px;color:#2B2420}   /* 黃底一律深字（深色模式量過 2.34:1 → 改固定深色） */

/* ---- 移動：台灣路網示意圖 ---- */
.netmap .hd{display:flex;align-items:baseline;gap:6px;justify-content:space-between}
.twwrap{display:flex;justify-content:center;margin:2px 0}
.tw{position:relative;flex:none;background:repeating-linear-gradient(0deg,transparent 0 23px,var(--muted) 23px 24px),repeating-linear-gradient(90deg,transparent 0 23px,var(--muted) 23px 24px);border:2px solid var(--line)}
.tw .edge{position:absolute;height:4px;margin-top:-2px;transform-origin:0 50%;background:var(--dash);pointer-events:none}
.tw .edge.e-ok{background:var(--green);height:6px;margin-top:-3px}
.tw .edge.e-part{background:repeating-linear-gradient(90deg,var(--yellow) 0 8px,var(--ink2) 8px 10px);height:6px;margin-top:-3px}
.tw .edge.e-lock{background:repeating-linear-gradient(90deg,var(--ink2) 0 6px,transparent 6px 10px)}
.tw .edge.e-stop{background:repeating-linear-gradient(90deg,var(--red) 0 6px,var(--paper) 6px 10px);height:6px;margin-top:-3px}
.tw .edge.e-road{background:#A87A4A;height:3px}
.tw .edge.e-sea-ok{background:repeating-linear-gradient(90deg,var(--blue) 0 4px,transparent 4px 7px);height:4px}
.tw .edge.e-sea-lock{background:repeating-linear-gradient(90deg,var(--ink2) 0 2px,transparent 2px 8px);height:3px}
.tw .edge.mine{box-shadow:0 0 0 2px var(--paper)}
.tw .node{position:absolute;width:44px;height:44px;background:none;border:none;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;color:var(--ink)}
.tw .node .dot{width:14px;height:14px;margin-top:6px;background:var(--paper);border:2px solid var(--line)}
.tw .node .nm{font-size:10px;font-weight:800;line-height:1.1;background:var(--app);padding:0 2px;white-space:nowrap}
.tw .node.far{opacity:.75}
.tw .node.far .nm{color:var(--ink2)}
.tw .node.nb .dot{background:var(--yellow);width:18px;height:18px;margin-top:4px;animation:nbpulse 1.2s steps(2,end) infinite}
.tw .node.nb .nm{font-weight:900}
.tw .node.sel .dot{background:var(--ink);border-color:var(--yellow);outline:3px solid var(--yellow)}
.tw .node.here .dot{background:var(--red);width:20px;height:20px;margin-top:3px;outline:3px solid var(--red);outline-offset:2px}
.tw .node.here .nm{color:var(--red-ink);font-weight:900}
.tw .node .you{position:absolute;top:4px;left:36px;white-space:nowrap;background:var(--red);color:var(--on-red);font-size:10px;font-weight:900;padding:1px 4px;border:1.5px solid var(--line);z-index:2}
.tw .node .you.l{left:auto;right:36px}
.netmap .hd{align-items:center}
.netmap .hd h2{font-size:14px;flex:1;min-width:0}
.pushchip{min-height:44px;font-size:11px;padding:0 8px;display:inline-flex;align-items:center;gap:3px;max-width:52%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tw .node .sup{position:absolute;right:0;top:0;font-size:9px;font-weight:900;line-height:12px;width:13px;height:13px;text-align:center;background:#34506B;color:#FBF6EA;border:1px solid var(--line)}
@keyframes nbpulse{0%{transform:scale(1)}50%{transform:scale(1.18)}}
.legend .e::before{background:#A87A4A} .legend .f::before{content:"補";display:inline-block;width:12px;height:12px;font-size:9px;line-height:11px;text-align:center;background:#34506B;color:#FBF6EA;vertical-align:-1px}
.legend .c::before{background:repeating-linear-gradient(90deg,var(--ink2) 0 3px,transparent 3px 5px)}
.rule{font-size:11.5px;line-height:1.45;background:var(--yellow);color:var(--on-yellow);border:2px solid var(--line);padding:4px 8px}
.rule b{font-weight:900}
.pickhint{flex-direction:row;align-items:center;gap:8px;font-size:12px;padding:8px}
.dest .hd .small b.supok{font-family:var(--sans);font-size:11px;color:var(--good)}

/* ---- 裝備：技能搭配 ---- */
.loadout{padding:6px 8px;display:flex;flex-direction:column;gap:5px;flex:1 1 auto;min-height:0}   /* 吃掉原本那排空白 */
#s-gear > .pick{margin-top:0}
.loadout .lab{display:flex;justify-content:space-between;align-items:baseline;font-size:12px;gap:6px}
.skopts{display:grid;grid-template-columns:repeat(3,1fr);grid-auto-rows:1fr;gap:5px;flex:1}
.opt.sk2.locked{background:var(--muted);color:var(--ink2);border-style:dashed}
.opt.sk2{flex-direction:column;gap:0;padding:2px 3px;min-height:44px}
.opt.sk2 b{font-size:12px}
.opt.sk2 small{font-size:9.5px;line-height:1.2;font-weight:700;opacity:.9}
.loadout .more{min-height:44px;font-size:11px;padding:0 8px;border-radius:2px}

/* ---- 戰績／圖鑑 ---- */
.dexhd{padding:6px 10px;display:flex;flex-direction:column;gap:4px}
.dexhd .lab{display:flex;justify-content:space-between;align-items:baseline}
.dexsum{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}
.dexsum span{display:flex;flex-direction:column;align-items:center;border:2px solid var(--line);background:var(--app);padding:3px}
.dexsum b{font-family:var(--pixel);font-size:11px;line-height:1.6}
.dexsum small{font-size:10px;color:var(--ink2)}
.dexlist{flex:1;min-height:0;overflow-y:auto;padding:2px 8px;overscroll-behavior:contain}
.dexit{display:flex;align-items:center;gap:8px;width:100%;min-height:52px;background:none;border:none;border-bottom:1.5px dashed var(--dash);text-align:left;color:var(--ink);padding:3px 0}
.dexit .n{flex:1;min-width:0;display:flex;flex-direction:column}
.dexit .n b{font-weight:900;font-size:13px}
.dexit .n small{font-size:10.5px;color:var(--ink2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dexit .cnt{font-family:var(--pixel);font-size:10px}
.thumb{width:44px;height:44px;flex:none;display:grid;place-items:center;background:var(--app);border:2px solid var(--line)}
.thumb img{width:40px;height:40px;object-fit:contain}
.pxmon{display:block;position:relative;width:26px;height:22px;background:var(--mon);border:2px solid #2B2420}
.pxmon > i{position:absolute;left:4px;top:5px;width:5px;height:5px;background:#FBF6EA;border:1px solid #2B2420;box-shadow:9px 0 0 -1px #FBF6EA,9px 0 0 0 #2B2420}
.m-taro{--mon:#9C86B5} .m-green{--mon:#7FA37A} .m-red{--mon:#D8664F} .m-blue{--mon:#6E8FAE} .m-yellow{--mon:#E2C066} .m-brown{--mon:#A87A4A}
.dexdesc{font-size:13px;line-height:1.5;border-left:4px solid var(--red);padding:2px 8px}
.srcs{display:flex;flex-wrap:wrap;gap:6px}
.srclink{display:inline-flex;align-items:center;min-height:44px;padding:0 6px;color:var(--blue);font-weight:800}
#hvDex{align-self:stretch;font-size:12px}

/* ---- 商店：不在補給站 ---- */
.empty.closed{gap:6px}
.empty.closed .btn{width:100%}

/* ---- 登入（開始畫面、設定） ---- */
.login{display:flex;flex-direction:column;gap:6px;align-items:stretch}
.login .gbtn{min-height:44px;display:flex;justify-content:center}
.login .devlogin{display:flex;flex-direction:column;gap:4px;border:2px dashed var(--line);padding:6px}
.login .devlogin input{min-height:44px;font-size:14px;letter-spacing:0}
.login .row2{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.login .row2 .btn{font-size:13px}
/* ---- v3 第二輪：分頁 4 個、地圖上的補給站鈕、角色頁 3D、異能 8 部位 ---- */
.tabs.four{grid-template-columns:repeat(4,1fr)}
.mapstation{display:none;position:absolute;left:6px;top:58px;z-index:900;align-items:center;gap:5px;min-height:44px;padding:2px 8px;background:#34506B;color:#FBF6EA;border:2px solid var(--line);box-shadow:3px 3px 0 var(--shadow);text-align:left}
.mapstation.on{display:flex}
.mapstation span{display:flex;flex-direction:column;line-height:1.2}
.mapstation b{font-size:13px;font-weight:900}
.mapstation small{font-size:10px}
.movebanner.on ~ .mapstation{display:none}
.btn.back{min-height:44px;font-size:13px;width:auto;align-self:flex-start;padding:0 14px}
/* 第三輪：背景改玩具風黃色放射紋（分享卡 char3d.js sunburst() 同一套），不分深淺色——這一格是「相片」 */
.stage3d{position:relative;flex:1 1 230px;min-height:230px;overflow:hidden;padding:0;background:repeating-conic-gradient(from 0deg at 50% 66%,#FFD23F 0 7.5deg,#FFC21A 7.5deg 15deg)}
.stage3d canvas.c3d{position:absolute;inset:0;width:100%;height:100%;display:block;cursor:grab}
.stage3d .fallback{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:120px;height:140px}
.stage3d .ttl3d{position:absolute;left:8px;top:8px;display:flex;flex-direction:column;gap:2px;background:var(--paper);border:2px solid var(--line);padding:4px 8px;max-width:60%;pointer-events:none}
.stage3d .ttl3d .big{font-weight:900;font-size:18px;color:var(--red-ink);line-height:1.15}
.stage3d .sharebtn{position:absolute;right:8px;bottom:8px;background:var(--red);color:var(--on-red);border-color:var(--line)}
.stage3d .fxbtn{position:absolute;left:8px;bottom:8px}
.stage3d .hint3d{position:absolute;right:8px;top:8px;font-size:10px;background:var(--paper);border:1.5px solid var(--line);padding:1px 5px;color:var(--ink2)}
.abparts{padding:6px 8px;display:flex;flex-direction:column;gap:5px;flex:none}
.abparts .lab{display:flex;justify-content:space-between;align-items:baseline;gap:6px;font-size:12px}
.abgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}
.abslot .ico{margin-bottom:1px}
.sharebtn{display:inline-flex;align-items:center;gap:4px}
.abslot{position:relative;min-height:48px;border:2px dashed var(--line);background:var(--muted);color:var(--ink2);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2px;line-height:1.15}
.abslot b{font-size:12px;font-weight:900}
.abslot small{font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.abslot.has{background:var(--paper);color:var(--ink)}
.abslot.on{background:var(--paper);color:var(--ink);border-style:solid;box-shadow:3px 3px 0 var(--shadow)}
.abslot .sw{position:absolute;left:3px;top:3px;width:10px;height:10px;border:1.5px solid var(--line)}
.abslot:not(.on) .sw{display:none}
.abswatch{width:36px;height:36px;flex:none;border:3px solid #2B2420}
.sk .k.ab{background:var(--taro);color:#2B2420}
#s-gear > .pick{margin-top:0}
.login .privacy{display:inline-flex;align-items:center;justify-content:center;min-height:44px;font-size:12px;color:var(--ink2);font-weight:700}
/* ---- 怪物 v3：剪影佔位圖（10 種輪廓＋bestiary 主色；美術交 img/mon/<id>.webp 之後換掉）、小故事卡、可點的故事紀錄 ---- */
.sil{display:inline-block;position:relative;width:36px;height:36px;flex:none;filter:drop-shadow(1px 0 0 #2B2420) drop-shadow(-1px 0 0 #2B2420) drop-shadow(0 1px 0 #2B2420) drop-shadow(0 -1px 0 #2B2420)}
.sil > i{position:absolute;inset:0;background:var(--mon,#9AA3A8)}
.s-wide > i{clip-path:polygon(0 45%,15% 45%,15% 30%,85% 30%,85% 45%,100% 45%,100% 100%,0 100%)}
.s-ghost > i{clip-path:polygon(20% 0,80% 0,100% 25%,100% 100%,80% 85%,60% 100%,40% 85%,20% 100%,0 85%,0 25%)}
.s-crawl > i{clip-path:polygon(0 55%,25% 40%,75% 40%,100% 55%,100% 80%,85% 80%,85% 100%,70% 80%,30% 80%,15% 100%,15% 80%,0 80%)}
.s-object > i{clip-path:polygon(15% 10%,85% 10%,85% 75%,70% 75%,70% 100%,30% 100%,30% 75%,15% 75%)}
.s-tall > i{clip-path:polygon(35% 0,65% 0,65% 25%,80% 25%,80% 60%,65% 60%,65% 100%,35% 100%,35% 60%,20% 60%,20% 25%,35% 25%)}
.s-swarm > i{clip-path:polygon(0 0,30% 0,30% 30%,0 30%,0 0,40% 35%,70% 35%,70% 65%,40% 65%,40% 35%,70% 0,100% 0,100% 30%,70% 30%,70% 0,10% 70%,40% 70%,40% 100%,10% 100%,10% 70%,65% 70%,95% 70%,95% 100%,65% 100%,65% 70%)}
.s-human > i{clip-path:polygon(35% 0,65% 0,65% 25%,90% 25%,90% 55%,70% 55%,70% 100%,55% 100%,55% 70%,45% 70%,45% 100%,30% 100%,30% 55%,10% 55%,10% 25%,35% 25%)}
.s-giant > i{clip-path:polygon(25% 0,75% 0,75% 15%,100% 15%,100% 65%,85% 65%,85% 100%,60% 100%,60% 75%,40% 75%,40% 100%,15% 100%,15% 65%,0 65%,0 15%,25% 15%)}
.s-quad > i{clip-path:polygon(0 20%,25% 20%,25% 35%,100% 35%,100% 70%,90% 70%,90% 100%,75% 100%,75% 70%,30% 70%,30% 100%,15% 100%,15% 70%,0 70%)}
.s-fly > i{clip-path:polygon(0 20%,35% 40%,35% 25%,65% 25%,65% 40%,100% 20%,100% 50%,65% 65%,65% 85%,35% 85%,35% 65%,0 50%)}
.thumb .sil{width:34px;height:34px}
.storycard{display:none;padding:6px 8px;flex:none;border-color:var(--yellow);gap:4px;flex-direction:column;animation:scin .3s steps(3,end)}
.storycard.on{display:flex}
@keyframes scin{from{transform:translateY(12px);opacity:0}to{transform:none;opacity:1}}
.storycard .sc-hd{display:flex;align-items:center;gap:8px}
.storycard .sc-more{flex:1;min-width:0;min-height:44px;display:flex;flex-direction:column;align-items:flex-start;background:none;border:none;padding:0;text-align:left;color:var(--ink);font:inherit;cursor:pointer}
.storycard .sc-more small{font-size:10px;color:var(--blue);font-weight:900}
.storycard .sc-more b{font-size:14px;font-weight:900;line-height:1.2}
.storycard .sc-more span{font-size:11.5px;line-height:1.35;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ink2)}
.storycard .sc-x{width:44px;height:44px;flex:none;border:2px solid var(--line);background:var(--paper);color:var(--ink);font-size:20px;font-weight:900}
.feed li .tx.story{background:none;border:none;padding:0;text-align:left;font:inherit;color:inherit;min-height:44px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.feed li .tx.story b{color:var(--blue);font-weight:900}
.feed li{min-height:0}
.dexhead{display:flex;align-items:center;gap:10px}
.dexhead .sil{width:48px;height:48px}
.dexhead .bossimg{width:72px;height:72px;flex:none;image-rendering:pixelated}
/* 第三輪：週團任頭目 */
.bossbox{display:flex;align-items:center;gap:8px;width:100%;min-height:88px;padding:4px 8px;border:2px solid var(--red);background:var(--paper);color:var(--ink);text-align:left;box-shadow:inset 0 0 0 2px var(--yellow)}
.bossbox img{width:80px;height:80px;flex:none;image-rendering:pixelated}
.bossbox .n{display:flex;flex-direction:column;gap:1px;min-width:0}
.bossbox b{font-size:15px;font-weight:900}
.bossbox small{font-size:10.5px;color:var(--ink2)}
.bossbox .legend{font-size:11px;font-weight:800;color:var(--red-ink)}
/* 第三輪：圖鑑縣市分頁＋剪影卡。戰績頁的清單要在框裡捲，不撐高整頁（.app 平常只有 min-height，清單一長整頁就被撐出一屏） */
.app:has(#s-dex.on){height:100vh;height:100dvh}
.dexregs{display:flex;gap:4px;overflow-x:auto;padding:2px 0 4px;scrollbar-width:thin;overscroll-behavior-x:contain}
.dexreg{flex:none;min-width:52px;min-height:44px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 6px;border:2px solid var(--line);background:var(--app);color:var(--ink)}
.dexreg b{font-size:12px;font-weight:900;line-height:1.2}
.dexreg small{font-family:var(--pixel);font-size:8px;color:var(--ink2)}
.dexreg.has{background:var(--paper)}
.dexreg.sel{background:var(--yellow);color:#2B2420}
.dexreg.sel small{color:#2B2420}
.dexgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:4px 0 8px}
.dexcard{display:flex;flex-direction:column;align-items:center;gap:2px;min-height:96px;padding:4px 2px;border:2px solid var(--line);background:var(--paper);color:var(--ink);text-align:center}
.dexcard .thumb{width:48px;height:48px;display:grid;place-items:center}
.dexcard .thumb img{width:48px;height:48px;object-fit:contain;image-rendering:pixelated}
.dexcard b{font-size:11px;font-weight:900;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.dexcard small{font-size:9.5px;color:var(--ink2);line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.dexcard.boss{border-color:var(--red);box-shadow:inset 0 0 0 2px var(--yellow)}
.dexcard.unmet{background:var(--muted);border-style:dashed}
.dexcard.unmet img.shadow{filter:brightness(0);opacity:.75}
.dexcard.unmet small{color:var(--ink)}
.dexline{font-size:13px;font-weight:800;color:var(--ink2)}
/* 勇者頭像：img/hero/hero.webp 交件後自動換（app.js probeArt） */
.ava.art{background:#FFD23F center/cover no-repeat}   /* 圖由 app.js heroAva() 掛 background-image */
.ava.art::before,.ava.art::after{display:none}
