/* mobile16pm A4 (pages): iPhone 16 Pro Max phone layout only. Every rule must sit inside @media (max-width:999.98px) and start with body:not(.desktop-game) (desktop >=1000px must not change). Loaded last (index.html), so it overrides style.css / mobile.css / campaign.css. */
/* Target: 430 × 932 CSS px, DPR 3, portrait. Text ≥ 12 px, tap targets ≥ 44 px, safe areas kept clear, pictures never drawn above their own pixels. */
@media (max-width:999.98px){

/* ───────── top bar: the gear (mobile-pages.mountPhoneSettings) takes the place of the old 「?」 (指南 is in the sheet, as on desktop) ───────── */
body:not(.desktop-game) .header-tools #mobile-help{display:none}
body:not(.desktop-game) .header-tools .mp-gear svg{width:22px;height:22px;stroke-width:1.6}

/* ───────── settings sheet (#mp-settings): bottom sheet, 56 px rows ───────── */
body:not(.desktop-game) dialog.mp-sheet{box-sizing:border-box;position:fixed;inset:auto 0 0 0;width:100vw;max-width:100vw;max-height:calc(100dvh - env(safe-area-inset-top) - 24px);margin:0;padding:0 max(12px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));overflow:auto;overscroll-behavior:contain;border:1px solid #d4b47755;border-bottom:0;border-radius:18px 18px 0 0;background:linear-gradient(180deg,#17232d,#0c141b 60%);color:#ede7d8;box-shadow:0 -12px 40px #000c;font:400 15px/1.4 Arial,'PingFang SC','Microsoft YaHei',sans-serif}
body:not(.desktop-game) dialog.mp-sheet:focus{outline:none}
body:not(.desktop-game) dialog.mp-sheet::backdrop{background:#03080dcc;backdrop-filter:blur(4px)}
body:not(.desktop-game) .mp-sheet-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 2px 8px;background:#17232df2}
body:not(.desktop-game) .mp-sheet-head::before{content:"";position:absolute;left:50%;top:5px;width:40px;height:4px;margin-left:-20px;border-radius:2px;background:#d4b47755}
body:not(.desktop-game) .mp-sheet-title{margin:6px 0 0 6px;font:700 19px/1.3 var(--serif,serif);letter-spacing:.2em;color:#f1d896}
body:not(.desktop-game) .mp-sheet-close{display:grid;place-items:center;width:44px;height:44px;margin-top:4px;padding:0;border:1px solid #d4b47777;border-radius:50%;background:#15212b;color:#f1d896;font:300 26px/1 Arial,sans-serif}
body:not(.desktop-game) .mp-sheet-list{display:flex;flex-direction:column;gap:6px;padding:4px 0 6px}
body:not(.desktop-game) .mp-set{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;min-height:56px;margin:0;padding:6px 14px 6px 8px;box-sizing:border-box;border:1px solid #d4b47733;border-radius:12px;background:linear-gradient(180deg,#1b2833,#121c25);color:inherit;font:inherit;text-align:left;-webkit-tap-highlight-color:transparent}
body:not(.desktop-game) .mp-set:active{filter:brightness(1.15)}
body:not(.desktop-game) .mp-set-ic{display:grid;place-items:center;width:40px;height:40px;border:1px solid #d4b47788;border-radius:50%;background:radial-gradient(circle at 50% 35%,#2b3a46,#101820);font:700 16px/1 var(--serif,serif);font-style:normal;color:#f1d896}
body:not(.desktop-game) .mp-set-txt{display:flex;flex-direction:column;gap:2px;min-width:0}
body:not(.desktop-game) .mp-set-txt b{font:700 16px/1.3 var(--serif,serif);letter-spacing:.06em;color:#fff2d2}
body:not(.desktop-game) .mp-set-txt small{font-size:12px;line-height:1.4;color:#a9b4b9;overflow-wrap:anywhere}
body:not(.desktop-game) .mp-set em{font-style:normal;font-size:14px;font-weight:700;color:#f1d896;white-space:nowrap;font-variant-numeric:tabular-nums}
body:not(.desktop-game) .mp-set em.is-arrow{font-size:22px;font-weight:400;color:#d4b477aa}
body:not(.desktop-game) .mp-set[role="menuitemcheckbox"][aria-checked="false"] em{color:#a9b4b9}
body:not(.desktop-game) .mp-set.is-unsupported{border-style:dashed;background:#10181f}
body:not(.desktop-game) .mp-set.is-unsupported .mp-set-ic,body:not(.desktop-game) .mp-set.is-unsupported b,body:not(.desktop-game) .mp-set.is-unsupported em{opacity:.6}
body:not(.desktop-game) .mp-set.is-unsupported small{color:#f0c27e}
body:not(.desktop-game) .mp-set.is-locked{opacity:.7}
/* 本地资源 window (page-preload): 预下载全部资源 is a 5 GB desktop feature — on the phone only its 清理本地缓存 section is shown. */
body:not(.desktop-game) #rune-storage-dialog [data-rp="all"]{display:none}
body:not(.desktop-game) #rune-storage-dialog :is(button,.rp-btn){min-height:44px}
body:not(.desktop-game) #rune-storage-dialog .rp-close{min-width:44px}

/* ───────── phone 排行榜 (page-board.mjs in .mp-layer): tabs 2 × 2, my card, rows as cards ───────── */
body:not(.desktop-game) .mp-layer .pg-board-bg,body:not(.desktop-game) .mp-layer .pg-board-stage>.uk-page-head>.uk-plaque,body:not(.desktop-game) .mp-layer .pg-board-stage>.uk-page-head>:is(.uk-page-head-tools,.uk-round,[data-pg-back]),body:not(.desktop-game) .mp-layer .pg-board-cols{display:none!important}
body:not(.desktop-game) .mp-layer .pg-board{position:relative;color:var(--mp-text)}
body:not(.desktop-game) .mp-layer .pg-board-stage{display:flex;flex-direction:column;gap:10px}
body:not(.desktop-game) .mp-layer .pg-board-stage>.uk-page-head{display:block;margin:0}
body:not(.desktop-game) .mp-layer .pg-board-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
body:not(.desktop-game) .mp-layer .pg-board-tab{display:flex;align-items:center;justify-content:flex-start;gap:8px;min-height:52px;padding:4px 10px;font-size:14px;line-height:1.2;text-align:left}
body:not(.desktop-game) .mp-layer .pg-board-tab img{flex:none;width:30px;height:32px;object-fit:contain;filter:drop-shadow(0 2px 3px #000a)}
body:not(.desktop-game) .mp-layer .pg-board-tab span{min-width:0}
body:not(.desktop-game) .mp-layer .pg-board-note{margin:0;padding:0 4px;font-size:13px;line-height:1.55;color:#d9c9a0}
body:not(.desktop-game) .mp-layer .pg-board-filter{display:flex;flex-direction:column;gap:8px}
body:not(.desktop-game) .mp-layer .pg-board-select{display:flex;align-items:center;gap:8px;font:700 14px/1.2 var(--mp-serif);color:var(--mp-gold-hi)}
body:not(.desktop-game) .mp-layer .pg-board-select select{flex:1;min-width:0;min-height:44px;padding:0 10px;border:1px solid #c9a25a99;border-radius:10px;background:#07101b;color:#fff2d2;font:700 14px/1.2 Arial,sans-serif}
body:not(.desktop-game) .mp-layer .pg-board-diffs{display:flex;gap:6px}
body:not(.desktop-game) .mp-layer .pg-board-diff{flex:1 1 0}
body:not(.desktop-game) .mp-layer .pg-board-main{display:flex;flex-direction:column;gap:10px}
body:not(.desktop-game) .mp-layer .pg-board-me-card{display:grid;grid-template-columns:76px minmax(0,1fr) auto;grid-template-areas:"ava name btn" "ava board btn" "ava rank btn";align-items:center;column-gap:12px;row-gap:2px;padding:10px 12px}
body:not(.desktop-game) .mp-layer .pg-board-me-ava{grid-area:ava;position:relative;width:76px;height:76px}
body:not(.desktop-game) .mp-layer .pg-board-me-face{position:absolute;left:13.7%;top:14.7%;width:72%;height:72%;border-radius:50%;object-fit:cover}
body:not(.desktop-game) .mp-layer .pg-board-me-frame{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none}
body:not(.desktop-game) .mp-layer .pg-board-me-ava.is-framed{display:grid;place-items:center}
body:not(.desktop-game) .mp-layer .pg-board-me-ava.is-framed .pg-board-me-face{position:static;width:calc(76px*var(--lk-hole,.72));height:calc(76px*var(--lk-hole,.72))}
body:not(.desktop-game) .mp-layer .pg-board-me-name{grid-area:name;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 18px/1.25 var(--mp-serif);color:#fff2d2;letter-spacing:.04em}
body:not(.desktop-game) .mp-layer .pg-board-me-title{grid-area:name;justify-self:end;display:none}
body:not(.desktop-game) .mp-layer .pg-board-me-board{grid-area:board;margin:0;display:flex;flex-wrap:wrap;gap:2px 8px;align-items:baseline;font:700 13px/1.35 var(--mp-serif);color:#d9c9a0}
body:not(.desktop-game) .mp-layer .pg-board-me-board small{font:400 12px/1.35 Arial,sans-serif;color:var(--mp-muted)}
body:not(.desktop-game) .mp-layer .pg-board-me-rank{grid-area:rank;margin:0;font:700 20px/1.2 var(--mp-serif);color:var(--mp-gold-hi);text-shadow:0 2px 2px #000a}
body:not(.desktop-game) .mp-layer .pg-board-me-value{display:none}
body:not(.desktop-game) .mp-layer .pg-board-me-card>.uk-btn{grid-area:btn;min-width:0;padding:6px 12px}
body:not(.desktop-game) .mp-layer .pg-board-table{display:flex;flex-direction:column;gap:6px}
body:not(.desktop-game) .mp-layer .pg-board-rows,body:not(.desktop-game) .mp-layer .pg-board-pinned{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
body:not(.desktop-game) .mp-layer .pg-board-pinned{padding-top:6px;border-top:1px dashed #c9a25a66}
body:not(.desktop-game) .mp-layer .pg-board-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto;grid-template-areas:"rank who value" "rank detail date";align-items:center;column-gap:10px;row-gap:2px;min-height:60px;padding:8px 12px 8px 8px;box-sizing:border-box;border:1px solid #d4b47733;border-radius:12px;background:linear-gradient(160deg,#16222d,#0e171f 70%)}
body:not(.desktop-game) .mp-layer .pg-board-row.is-self{border-color:var(--mp-gold-hi);background:linear-gradient(160deg,#2c2414,#16120a 75%);box-shadow:0 0 10px #ffd27a33}
body:not(.desktop-game) .mp-layer .pg-board-rank{grid-area:rank;position:relative;display:grid;place-items:center;width:40px;height:44px;justify-self:center}
body:not(.desktop-game) .mp-layer .pg-board-rank b{position:relative;font:700 18px/1 var(--mp-serif);color:#ede7d8;font-variant-numeric:tabular-nums}
body:not(.desktop-game) .mp-layer .pg-board-rank.is-top img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 3px #000b)}
body:not(.desktop-game) .mp-layer .pg-board-rank.is-top b{font-size:14px;color:#fff6dc;text-shadow:0 1px 2px #000,0 0 6px #000}
body:not(.desktop-game) .mp-layer .pg-board-who{grid-area:who;display:flex;align-items:center;gap:8px;min-width:0}
body:not(.desktop-game) .mp-layer .pg-board-ava{flex:none;width:32px;height:32px;border-radius:50%;object-fit:cover;box-shadow:0 0 0 2px #b0894a}
body:not(.desktop-game) .mp-layer .pg-board-look{flex:none;width:36px;height:36px;display:grid;place-items:center}
body:not(.desktop-game) .mp-layer .pg-board-look>.pg-board-ava{width:calc(36px*var(--lk-hole,.8));height:calc(36px*var(--lk-hole,.8));box-shadow:none}
body:not(.desktop-game) .mp-layer .pg-board-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 15px/1.25 var(--mp-serif);color:#fff2d2}
body:not(.desktop-game) .mp-layer .pg-board-title{flex:0 1 auto;min-width:0;max-width:45%;font-size:12px}
body:not(.desktop-game) .mp-layer .pg-board-me{flex:none;padding:1px 6px;border-radius:4px;background:#d4b477;color:#3a2410;font:700 12px/1.3 var(--mp-serif);font-style:normal}
body:not(.desktop-game) .mp-layer .pg-board-value{grid-area:value;font:700 17px/1.2 var(--mp-serif);color:#ffe7a0;font-variant-numeric:tabular-nums lining-nums;white-space:nowrap;text-align:right}
body:not(.desktop-game) .mp-layer .pg-board-detail{grid-area:detail;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#d9c9a0}
body:not(.desktop-game) .mp-layer .pg-board-date{grid-area:date;font-size:12px;color:var(--mp-muted);font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right}
body:not(.desktop-game) .mp-layer .pg-board-empty{margin:20px 8px;font-size:14px;line-height:1.7;color:#d9c9a0;text-align:center}
body:not(.desktop-game) .mp-layer .pg-board-foot{display:flex;align-items:center;justify-content:center;gap:14px;padding:4px 0}
body:not(.desktop-game) .mp-layer .pg-board-total{font-size:12px;color:var(--mp-muted)}
body:not(.desktop-game) .mp-layer .pg-board-info{display:flex;flex-direction:column;gap:10px}
body:not(.desktop-game) .mp-layer .pg-board-info h2{margin:0;font:700 17px/1.3 var(--mp-serif);letter-spacing:.1em;color:var(--mp-gold-hi)}
body:not(.desktop-game) .mp-layer .pg-board-info ul{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:8px;font-size:13px;line-height:1.6}
body:not(.desktop-game) .mp-layer .pg-board-info b{display:block;color:var(--mp-gold-hi);font-family:var(--mp-serif)}
body:not(.desktop-game) .mp-layer .pg-board-row{animation:mp-board-in .24s ease-out both;animation-delay:calc(var(--i,0)*25ms)}
@keyframes mp-board-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

/* 养成: the 奥林波斯 filter chip (olympus-ui) sized like the element gems; the tab bar a little apart from the hero panel. */
body:not(.desktop-game) .mp-layer .pg-train-origin{width:44px;height:44px;min-width:44px}
body:not(.desktop-game) .mp-layer .pg-train-filters{gap:2px}

/* ───────── guide (#guide-dialog, the plain phone dialog): 13–15 px text, keyboard section → the shared notice line ───────── */
body:not(.desktop-game) #guide-dialog:not([data-ui-skinned]){box-sizing:border-box;width:calc(100vw - 16px);max-width:none;max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);padding:20px 18px calc(18px + env(safe-area-inset-bottom))}
body:not(.desktop-game) #guide-dialog .modal-close{width:44px;height:44px;right:6px;top:6px}
body:not(.desktop-game) #guide-dialog .eyebrow{font-size:12px;letter-spacing:2px}
body:not(.desktop-game) #guide-dialog h2{font-size:22px;line-height:1.45;margin:10px 44px 8px 0}
body:not(.desktop-game) #guide-dialog .modal-intro{font-size:14px;line-height:1.75;color:#b8c3be}
body:not(.desktop-game) #guide-dialog .guide-steps{margin:16px 0}
body:not(.desktop-game) #guide-dialog .guide-steps li{gap:14px;margin-bottom:18px}
body:not(.desktop-game) #guide-dialog .guide-steps li>b{flex:none;width:44px;font-size:26px}
body:not(.desktop-game) #guide-dialog .guide-steps h3{font-size:16px;line-height:1.4;margin:0 0 4px}
body:not(.desktop-game) #guide-dialog .guide-steps p{font-size:14px;line-height:1.7;color:#b8c3be}
body:not(.desktop-game) #guide-dialog .guide-mechanics h3{display:flex;align-items:center;gap:10px;font-size:17px;line-height:1.4}
body:not(.desktop-game) #guide-dialog .guide-mechanics h3::before{content:"";flex:none;width:36px;height:36px;background:center/contain no-repeat}
body:not(.desktop-game) #guide-dialog .guide-mechanics h3:nth-of-type(1)::before{background-image:url("./assets/m16/guide-badge-waves-128.webp")}
body:not(.desktop-game) #guide-dialog .guide-mechanics h3:nth-of-type(2)::before{background-image:url("./assets/m16/guide-badge-leader-128.webp")}
body:not(.desktop-game) #guide-dialog .guide-mechanics h3:nth-of-type(3)::before{background-image:url("./assets/m16/guide-badge-enhance-128.webp")}
body:not(.desktop-game) #guide-dialog .guide-mechanics h3:nth-of-type(4)::before{background-image:url("./assets/m16/guide-badge-hazard-128.webp")}
body:not(.desktop-game) #guide-dialog .guide-mechanics h3:nth-of-type(5)::before{background-image:url("./assets/m16/guide-badge-shield-128.webp")}
body:not(.desktop-game) #guide-dialog .guide-mechanics h3:nth-of-type(6)::before{background-image:url("./assets/m16/guide-badge-element-128.webp")}
body:not(.desktop-game) #guide-dialog .guide-mechanics h3:nth-of-type(7)::before{background-image:url("./assets/m16/guide-badge-skill-128.webp")}
body:not(.desktop-game) #guide-dialog .guide-mechanics h3:nth-of-type(8)::before{background-image:url("./assets/m16/guide-badge-summon-128.webp")}
body:not(.desktop-game) #guide-dialog .guide-mechanics p{font-size:14px;line-height:1.75}
body:not(.desktop-game) #guide-dialog>.keyboard-help{display:none}
body:not(.desktop-game) #guide-dialog>.guide-keys-phone{margin:6px 0 18px}
body:not(.desktop-game) #guide-dialog>.primary-button{min-height:50px;width:100%}

/* ───────── result (#end-dialog, the plain phone dialog) ───────── */
body:not(.desktop-game) #end-dialog:not([data-ui-skinned]){box-sizing:border-box;width:calc(100vw - 16px);max-width:none;max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px);padding:22px 18px calc(16px + env(safe-area-inset-bottom));background:radial-gradient(ellipse at 50% 0%,#3a2f17 0,#1d2526 38%,#121a1e 100%);border-color:#d4b47788}
body:not(.desktop-game) #end-dialog .end-seal{font-size:54px;line-height:1;margin:0 0 6px}
body:not(.desktop-game) #end-dialog .end-stars{display:flex;justify-content:center;gap:6px;margin:-2px 0 6px}
body:not(.desktop-game) #end-dialog .end-stars[hidden]{display:none}
body:not(.desktop-game) #end-dialog .end-stars i{font-style:normal;font-size:30px;line-height:1;color:#3d4448;text-shadow:0 1px 0 #000}
body:not(.desktop-game) #end-dialog .end-stars i.is-on{color:#ffd56b;text-shadow:0 0 10px #ffc94a99,0 2px 2px #000}
body:not(.desktop-game) #end-dialog .eyebrow{font-size:12px;letter-spacing:3px}
body:not(.desktop-game) #end-dialog h2{font-size:24px;line-height:1.4;margin:8px 0 10px}
body:not(.desktop-game) #end-dialog .end-rewards{display:flex;justify-content:center;gap:10px;margin:4px 0 12px}
body:not(.desktop-game) #end-dialog .end-rewards[hidden]{display:none}
body:not(.desktop-game) #end-dialog .end-reward{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:2px;flex:0 1 112px;min-width:0;min-height:108px;padding:8px 6px;box-sizing:border-box;border:1px solid #d4b47755;border-radius:12px;background:linear-gradient(180deg,#1f2a30,#121a1f)}
body:not(.desktop-game) #end-dialog .end-reward>i{display:block;width:44px;height:52px;margin-bottom:2px;background:center/contain no-repeat;filter:drop-shadow(0 3px 4px #000a)}
body:not(.desktop-game) #end-dialog .end-reward.is-gem>i{background-image:url("./assets/pages/_kit/icon-gem.webp")}
body:not(.desktop-game) #end-dialog .end-reward.is-xp>i{background-image:url("./assets/pages/_kit/icon-xp.webp")}
body:not(.desktop-game) #end-dialog .end-reward.is-hero>i{width:44px;height:58px;border:2px solid #d4b477;border-radius:6px;background-image:var(--hero-art,url("./assets/heroes.png"));background-size:var(--hero-size,500% auto);background-position:calc(var(--portrait,0)*25%) 18%;filter:none;box-shadow:0 2px 8px #000a}
body:not(.desktop-game) #end-dialog .end-reward b{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 18px/1.2 var(--serif,serif);color:#fff2d2;font-variant-numeric:tabular-nums}
body:not(.desktop-game) #end-dialog .end-reward.is-hero b{font-size:14px}
body:not(.desktop-game) #end-dialog .end-reward small{font-size:12px;color:#c8bb98}
body:not(.desktop-game) #end-dialog #end-description{font-size:14px;line-height:1.7;color:#c2ccc8}
body:not(.desktop-game) #end-dialog .end-mats-title{font-size:12px}
body:not(.desktop-game) #end-dialog .end-mat{min-height:32px;font-size:13px}
body:not(.desktop-game) #end-dialog .end-mat i{width:20px;height:20px}
body:not(.desktop-game) #end-dialog .end-rank{display:flex;align-items:center;justify-content:center;gap:12px;margin:12px 0 0}
body:not(.desktop-game) #end-dialog .end-rank[hidden],body:not(.desktop-game) #end-dialog .end-rank:empty{display:none}
body:not(.desktop-game) #end-dialog .end-rank .cs-medal{position:relative;flex:none;width:86px;height:80px}
body:not(.desktop-game) #end-dialog .end-rank .cs-medal-art{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
body:not(.desktop-game) #end-dialog .end-rank .cs-medal-face{position:absolute;left:31%;top:7%;width:38%;height:41%;border-radius:50%;object-fit:cover}
body:not(.desktop-game) #end-dialog .end-rank .cs-medal-rank{position:absolute;left:12%;right:12%;bottom:13%;font:700 12px/1 var(--serif,serif);color:#fff;text-align:center;text-shadow:0 1px 2px #000;white-space:nowrap}
body:not(.desktop-game) #end-dialog .end-rank .cs-rank-side{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0;text-align:left}
body:not(.desktop-game) #end-dialog .end-rank .cs-burst{position:relative;display:inline-grid;place-items:center;width:84px;height:44px}
body:not(.desktop-game) #end-dialog .end-rank .cs-burst img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
body:not(.desktop-game) #end-dialog .end-rank .cs-burst b{position:relative;font:700 12px/1 var(--serif,serif);color:#fff;text-shadow:0 1px 2px #000}
body:not(.desktop-game) #end-dialog .end-rank :is(.cs-rank-line,.cs-rank-wait){font-size:13px;line-height:1.45;color:#e6dcc0}
body:not(.desktop-game) #end-dialog .end-rank .cs-rank-line.is-up b{color:#9fe3b9}
body:not(.desktop-game) #end-dialog .end-stats{margin:16px 0 18px;padding:14px 0}
body:not(.desktop-game) #end-dialog .end-stats strong{font-size:28px}
body:not(.desktop-game) #end-dialog .end-stats span{font-size:13px;color:#b8c3be}
body:not(.desktop-game) #end-dialog>:is(.primary-button,.secondary-button){min-height:50px;font-size:15px}
body:not(.desktop-game) #end-dialog>.secondary-button{width:100%;margin:0 0 8px}

/* ───────── opening video (#opening-dialog.is-phone): full-screen cinema, own 44 px controls, optional 90° 横屏观看 ───────── */
body:not(.desktop-game) #opening-dialog.is-phone{box-sizing:border-box;position:fixed;inset:0;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;padding:calc(12px + env(safe-area-inset-top)) max(0px,env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(0px,env(safe-area-inset-left));display:flex;flex-direction:column;justify-content:center;gap:12px;overflow:hidden;border:0;border-radius:0;background:radial-gradient(ellipse at 50% 45%,#141d24 0,#05080b 70%);color:#ede7d8}
body:not(.desktop-game) #opening-dialog.is-phone::backdrop{background:#000}
body:not(.desktop-game) #opening-dialog.is-phone:not([open]){display:none} /* mobile16pm verify (Codex #1): a closed phone cinema must not stay on screen */
body:not(.desktop-game) #opening-dialog.is-phone>.modal-close{position:absolute;right:max(10px,env(safe-area-inset-right));top:calc(8px + env(safe-area-inset-top));z-index:3;display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid #d4b47788;border-radius:50%;background:#0b131acc;color:#f1d896;font:300 26px/1 Arial,sans-serif}
body:not(.desktop-game) #opening-dialog.is-phone>.eyebrow{margin:0 16px;font-size:12px;letter-spacing:3px;text-align:center}
body:not(.desktop-game) #opening-dialog.is-phone>h2{margin:0 16px;font-size:22px;line-height:1.4;text-align:center;color:#f3dfae}
body:not(.desktop-game) #opening-dialog.is-phone>video{flex:none;width:100%;max-height:none;aspect-ratio:16/9;border:0;border-block:1px solid #d4b47744;border-radius:0;background:#000;cursor:pointer}
body:not(.desktop-game) #opening-dialog.is-phone>p{margin:0 16px;font-size:13px;line-height:1.6;letter-spacing:1px;text-align:center;color:#b8c3be}
body:not(.desktop-game) #opening-dialog.is-phone>.op-ctl{display:grid;grid-template-columns:44px auto minmax(0,1fr) 44px 44px;align-items:center;gap:8px;margin:0 12px}
body:not(.desktop-game) #opening-dialog>.op-ctl[hidden]{display:none}
body:not(.desktop-game) #opening-dialog .op-btn{display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid #d4b47777;border-radius:50%;background:#101a22;color:#f1d896}
body:not(.desktop-game) #opening-dialog .op-btn svg{width:20px;height:20px;fill:currentColor}
body:not(.desktop-game) #opening-dialog .op-btn.op-play{background:linear-gradient(180deg,#ecd08e,#b88d45);border-color:#f3dba0;color:#2a1906}
body:not(.desktop-game) #opening-dialog .op-btn[aria-pressed="true"]{background:#3a2f17;border-color:#f1d896}
body:not(.desktop-game) #opening-dialog .op-time{font:700 13px/1 Arial,sans-serif;color:#d9c9a0;font-variant-numeric:tabular-nums;white-space:nowrap}
body:not(.desktop-game) #opening-dialog .op-seek{width:100%;min-width:0;height:44px;margin:0;accent-color:#d4b477;background:transparent}
body:not(.desktop-game) #opening-dialog.is-phone.is-paused>video{filter:brightness(.8)}
/* 横屏观看: the whole dialog turned 90° clockwise, its width = the screen height, so the film fills the long side. */
body:not(.desktop-game) #opening-dialog.is-phone.is-rotated{inset:auto;left:50%;top:50%;width:100dvh;height:100vw;max-width:none;max-height:none;padding:max(8px,env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-top));transform:translate(-50%,-50%) rotate(90deg);gap:6px}
body:not(.desktop-game) #opening-dialog.is-phone.is-rotated>:is(.eyebrow,h2,p){display:none}
body:not(.desktop-game) #opening-dialog.is-phone.is-rotated>video{flex:1 1 auto;width:auto;height:auto;min-height:0;max-width:100%;align-self:center;border:0}
body:not(.desktop-game) #opening-dialog.is-phone.is-rotated>.modal-close{top:max(8px,env(safe-area-inset-left));right:calc(10px + env(safe-area-inset-top))}
body:not(.desktop-game) #opening-dialog.is-phone.is-rotated>.op-ctl{margin:0 60px 0 8px}

/* ───────── tutorial bubble / dialog: the phone body text ≥ 12 px ───────── */
body:not(.desktop-game) #tutorial-dialog .eyebrow{font-size:12px}
body:not(.desktop-game) #tutorial-dialog .modal-close{width:44px;height:44px}
body:not(.desktop-game) #tutorial-dialog>.primary-button{min-height:48px}

/* ───────── page footer: 开场动画 / 冒险指南 links as 44 px buttons ───────── */
body:not(.desktop-game) .page-footer :is(#opening-button,#footer-help){min-height:44px;padding:0 12px}
body:not(.desktop-game) .page-footer{font-size:12px}
}
