/* 云存档：首次起名对话框、冲突提示、「另一个窗口」横幅（.rc-）+ 齿轮旁的同步小牌、资料卡（.cs-）。
   .rc- 部分在游戏启动前就会出现（那时 body 还没有 desktop-game），所以不依赖 ui-kit 的作用域，只借用它的石板/按钮美术。 */
.rc-modal{--rc-gold:#f1d896;--rc-gold-lo:#c9a25a;--rc-text:#ede7d8;--rc-muted:#a8b3b9;--rc-serif:"RuneSerif","Noto Serif SC","Noto Serif CJK SC","Source Han Serif SC","Songti SC",serif;--rc-sans:"Noto Sans SC","Noto Sans CJK SC","Source Han Sans SC","Microsoft YaHei",sans-serif;
  width:min(700px,calc(100vw - 24px));max-height:calc(100vh - 24px);box-sizing:border-box;padding:0;margin:auto;border:0;background:none;color:var(--rc-text);overflow:visible}
.rc-modal::backdrop{background:radial-gradient(ellipse at 50% 40%,#0d1a2bf2,#03070dfc)}
.rc-panel{position:relative;box-sizing:border-box;max-height:calc(100vh - 24px);overflow:auto;padding:clamp(18px,3vh,30px) clamp(18px,3vw,34px);border-style:solid;border-color:transparent;border-width:clamp(22px,3.6vh,38px);border-image:url("./assets/ui-display/pages/_kit/panel-2752.webp") 200 fill / clamp(22px,3.6vh,38px) stretch;background:linear-gradient(#0b1622f2,#07101bf2) padding-box;filter:drop-shadow(0 18px 40px #000c);text-align:center}
.rc-title{margin:0 0 10px;font:700 clamp(24px,3.6vh,34px)/1.2 var(--rc-serif);letter-spacing:.14em;background:linear-gradient(180deg,#f6e2a8,#c9a25a);-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 2px 1px #000a)}
.rc-lead{margin:0 auto 14px;max-width:30em;font:400 clamp(14px,1.9vh,17px)/1.6 var(--rc-sans);color:var(--rc-text)}
.rc-notice,.rc-warn{margin:0 auto 12px;max-width:32em;padding:8px 12px;border-radius:6px;font:400 clamp(13px,1.8vh,16px)/1.5 var(--rc-sans)}
.rc-notice{background:#3a1d1599;color:#ffd9c4;box-shadow:inset 0 0 0 1px #e0584a88}
.rc-warn{background:#2f261099;color:#f6e2a8;box-shadow:inset 0 0 0 1px #c9a25a88}
.rc-field{display:flex;align-items:center;justify-content:center;gap:12px;margin:6px auto 2px;font:700 clamp(15px,2vh,18px)/1 var(--rc-serif);color:var(--rc-gold);letter-spacing:.1em}
.rc-input{width:min(300px,60vw);height:clamp(38px,5vh,48px);box-sizing:border-box;padding:0 14px;border:1px solid #c9a25a99;border-radius:6px;background:#050b13;color:#fff4dc;font:700 clamp(17px,2.3vh,21px)/1 var(--rc-sans);letter-spacing:.06em;outline:none;box-shadow:inset 0 2px 6px #000c}
.rc-input:focus{border-color:var(--rc-gold);box-shadow:inset 0 2px 6px #000c,0 0 0 2px #f1d89655}
.rc-code-input{text-transform:uppercase;letter-spacing:.24em;text-align:center;font-family:var(--rc-serif)}
.rc-msg{min-height:1.5em;margin:4px 0 8px;font:400 clamp(13px,1.8vh,15px)/1.5 var(--rc-sans);color:var(--rc-muted)}
.rc-msg.is-ok{color:#8fe08f}.rc-msg.is-bad{color:#ff9c8c}
.rc-avatars{display:flex;justify-content:center;gap:clamp(8px,1.2vw,16px);margin:4px 0 12px;flex-wrap:wrap}
.rc-avatar{--s:clamp(56px,9vh,88px);position:relative;width:var(--s);height:var(--s);padding:0;border:0;border-radius:50%;background:radial-gradient(circle,#1a2b40,#07101b);cursor:pointer;box-shadow:0 0 0 3px #8a6a32,0 6px 14px #000b;transition:transform .16s ease,box-shadow .16s ease}
.rc-avatar img{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover;pointer-events:none}
.rc-avatar:hover{transform:translateY(-3px)}
.rc-avatar:focus-visible{outline:2px solid #fff;outline-offset:5px}
.rc-avatar.is-picked{box-shadow:0 0 0 4px #f1d896,0 0 22px #ffd27acc,0 6px 14px #000b;transform:translateY(-3px) scale(1.06)}
.rc-avatar.is-picked::after{content:"✓";position:absolute;right:-4px;bottom:-4px;display:grid;place-items:center;width:28%;aspect-ratio:1;border-radius:50%;background:#d4b477;color:#3a2410;font:900 clamp(12px,1.8vh,18px)/1 var(--rc-sans);box-shadow:0 2px 4px #000a}
.rc-progress{margin:0 auto 14px;max-width:32em;font:400 clamp(13px,1.8vh,15px)/1.5 var(--rc-sans);color:#d9c9a0}
.rc-small{margin:12px auto 0;max-width:32em;font:400 clamp(12px,1.6vh,14px)/1.5 var(--rc-sans);color:var(--rc-muted)}
.rc-actions{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:6px}
.rc-btn{--h:clamp(42px,5.8vh,58px);display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:calc(var(--h)*3.6);height:var(--h);padding:0 calc(var(--h)*.5);border-style:solid;border-color:transparent;border-width:calc(var(--h)*120/423) calc(var(--h)*200/423);border-image:url("./assets/pages/_kit/btn-secondary.webp") 120 200 fill / calc(var(--h)*120/423) calc(var(--h)*200/423) stretch;background:none;color:var(--rc-gold);font:700 clamp(15px,calc(var(--h)*.34),21px)/1 var(--rc-serif);letter-spacing:.12em;text-indent:.12em;white-space:nowrap;cursor:pointer;text-shadow:0 1px 2px #000c;filter:drop-shadow(0 4px 6px #000a);transition:transform .16s ease,filter .16s ease}
.rc-btn--primary{border-image-source:url("./assets/pages/_kit/btn-primary.webp");color:#3a2410;text-shadow:0 1px 0 #f6e2a880;min-width:calc(var(--h)*4.4)}
.rc-btn:not(:disabled):hover{transform:translateY(-2px);filter:brightness(1.12) drop-shadow(0 6px 8px #000a)}
.rc-btn:disabled{border-image-source:url("./assets/pages/_kit/btn-disabled.webp");color:#9aa0a4;text-shadow:none;cursor:not-allowed}
.rc-btn:focus-visible,.rc-link:focus-visible{outline:2px solid #fff;outline-offset:3px}
.rc-link{padding:4px 8px;border:0;background:none;color:#9fc7ff;font:400 clamp(13px,1.8vh,15px)/1.4 var(--rc-sans);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.rc-who{display:flex;align-items:center;justify-content:center;gap:14px;margin:4px 0 12px}
.rc-who img{width:clamp(56px,8vh,80px);height:clamp(56px,8vh,80px);border-radius:50%;object-fit:cover;box-shadow:0 0 0 3px #d4b477,0 6px 14px #000b}
.rc-who b{font:700 clamp(20px,3vh,28px)/1 var(--rc-serif);color:#fff2d2;letter-spacing:.08em}
.rc-code{display:flex;align-items:center;justify-content:center;gap:16px;margin:0 0 14px}
.rc-code b{white-space:nowrap;padding:8px 18px;border-radius:6px;background:#050b13;box-shadow:inset 0 0 0 1px #c9a25a99;font:700 clamp(24px,3.6vh,34px)/1 var(--rc-serif);letter-spacing:.2em;color:#fff2d2;user-select:all}
.rc-banner{position:fixed;left:50%;top:10px;z-index:2147483000;transform:translateX(-50%);display:flex;align-items:center;gap:14px;max-width:calc(100vw - 24px);box-sizing:border-box;padding:10px 12px 10px 18px;border-radius:8px;background:#2f2610f2;box-shadow:inset 0 0 0 1px #c9a25a,0 8px 24px #000c;color:#f6e2a8;font:400 15px/1.4 "Noto Sans SC","Microsoft YaHei",sans-serif}
.rc-banner button{flex:none;width:28px;height:28px;border:0;border-radius:50%;background:#0006;color:#f6e2a8;font:700 18px/1 sans-serif;cursor:pointer}
@media (prefers-reduced-motion:reduce){.rc-avatar,.rc-btn{transition:none}}

/* ---------------- 桌面版（游戏启动后，ui-kit 作用域内）：顶栏小牌、资料卡、结算页排行徽章 ---------------- */
body.desktop-game .cs-chip{flex:none;display:flex;align-items:center;gap:8px;height:calc(var(--ds-header,58px)*.68);max-width:220px;box-sizing:border-box;padding:0 12px 0 4px;border:0;border-radius:999px;background:linear-gradient(90deg,#0b1622,#13202ecc);box-shadow:inset 0 0 0 1px #c9a25a88,0 3px 8px #0008;color:#f1dfb3;cursor:pointer;font:700 14px/1 var(--uk-serif,serif);transition:filter .16s ease}
body.desktop-game .cs-chip:hover{filter:brightness(1.15)}
body.desktop-game .cs-chip:focus-visible{outline:2px solid #f1d896;outline-offset:2px}
body.desktop-game .cs-chip-ava{flex:none;width:calc(var(--ds-header,58px)*.56);height:calc(var(--ds-header,58px)*.56);border-radius:50%;object-fit:cover;box-shadow:0 0 0 2px #d4b477}
body.desktop-game .cs-chip-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.06em}
body.desktop-game .cs-chip-state{flex:none;display:flex;align-items:center;gap:5px;font:400 12px/1 var(--uk-sans,sans-serif);color:#a8b3b9;letter-spacing:.04em}
body.desktop-game .cs-chip-state i{width:8px;height:8px;border-radius:50%;background:#6fd36f;box-shadow:0 0 6px #6fd36f}
body.desktop-game .cs-chip.is-syncing .cs-chip-state i{background:none;box-shadow:inset 0 0 0 2px #e8c45a;animation:cs-spin 1s linear infinite}
body.desktop-game .cs-chip.is-offline .cs-chip-state i{background:none;box-shadow:inset 0 0 0 2px #a8b3b9}
body.desktop-game .cs-chip.is-error .cs-chip-state i{background:#e0584a;box-shadow:0 0 6px #e0584a}
@keyframes cs-spin{50%{opacity:.35}}
@media (min-width:1900px){body.desktop-game .cs-chip{max-width:260px;font-size:16px}body.desktop-game .cs-chip-state{font-size:14px}}
@media (max-width:1400px){body.desktop-game .cs-chip-name{max-width:5.5em}}

body.desktop-game dialog.cs-profile{--pg-u:min(calc((100vh - var(--uk-header,68px)) / 100),calc(100vw / 150));width:min(calc(var(--pg-u)*118),calc(100vw - 40px));max-height:calc(100vh - 24px);box-sizing:border-box;margin:auto;padding:0;border:0;background:none;color:var(--uk-text);overflow:visible}
body.desktop-game dialog.cs-profile::backdrop{background:#03070dcc}
body.desktop-game .cs-card{position:relative;display:flex;flex-direction:column;gap:calc(var(--pg-u)*1.2);padding:calc(var(--pg-u)*2) calc(var(--pg-u)*2.4);border-radius:10px;background:radial-gradient(ellipse at 50% 0%,#162a3df5,#07101bf8 70%);box-shadow:inset 0 0 0 1px #c9a25a99,0 20px 60px #000d}
body.desktop-game .cs-head{display:flex;align-items:center;justify-content:space-between;gap:var(--uk-gap)}
body.desktop-game .cs-cols{display:grid;grid-template-columns:1fr 1fr;gap:calc(var(--pg-u)*1.6)}
body.desktop-game .cs-col{display:flex;flex-direction:column;gap:calc(var(--pg-u)*1.4);min-width:0}
body.desktop-game .cs-block h3{margin:0 0 calc(var(--pg-u)*.6);font:700 max(var(--uk-min,12px),calc(var(--pg-u)*1.9))/1.2 var(--uk-serif);letter-spacing:.1em;color:#f1d896}
body.desktop-game .cs-who{display:flex;align-items:center;gap:calc(var(--pg-u)*1.6)}
body.desktop-game .cs-ava{flex:none;width:calc(var(--pg-u)*11);height:calc(var(--pg-u)*11);padding:0;border:0;border-radius:50%;background:#07101b;cursor:pointer;box-shadow:0 0 0 3px #d4b477,0 6px 14px #000b}
body.desktop-game .cs-ava img{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover}
body.desktop-game .cs-ava:focus-visible{outline:2px solid #fff;outline-offset:4px}
body.desktop-game .cs-who-text,.cs-rename{display:flex;flex-direction:column;gap:calc(var(--pg-u)*.8);min-width:0}
body.desktop-game .cs-name{font:700 max(16px,calc(var(--pg-u)*3))/1.1 var(--uk-serif);color:#fff2d2;letter-spacing:.06em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.desktop-game .cs-row{display:flex;align-items:center;gap:calc(var(--pg-u)*.8);flex-wrap:wrap}
body.desktop-game .cs-input{height:max(34px,calc(var(--pg-u)*4.4));box-sizing:border-box;min-width:0;width:calc(var(--pg-u)*22);padding:0 12px;border:1px solid #c9a25a99;border-radius:6px;background:#050b13;color:#fff4dc;font:700 max(14px,calc(var(--pg-u)*1.9))/1 var(--uk-sans);outline:none}
body.desktop-game .cs-input:focus{border-color:#f1d896;box-shadow:0 0 0 2px #f1d89655}
body.desktop-game .cs-code-input{text-transform:uppercase;letter-spacing:.2em;font-family:var(--uk-serif)}
body.desktop-game .cs-avatars{display:flex;gap:calc(var(--pg-u)*1.2);justify-content:center}
body.desktop-game .cs-ava-pick{width:calc(var(--pg-u)*7.6);height:calc(var(--pg-u)*7.6);padding:0;border:0;border-radius:50%;background:#07101b;cursor:pointer;box-shadow:0 0 0 2px #8a6a32,0 4px 10px #000b;transition:transform .15s ease}
body.desktop-game .cs-ava-pick img{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover}
body.desktop-game .cs-ava-pick:hover{transform:translateY(-2px)}
body.desktop-game .cs-ava-pick.is-picked{box-shadow:0 0 0 3px #f1d896,0 0 16px #ffd27acc}
body.desktop-game .cs-code{display:flex;align-items:center;gap:calc(var(--pg-u)*1.2)}
body.desktop-game .cs-code b{padding:calc(var(--pg-u)*.6) calc(var(--pg-u)*1.4);border-radius:6px;background:#050b13;box-shadow:inset 0 0 0 1px #c9a25a99;font:700 max(18px,calc(var(--pg-u)*3))/1 var(--uk-serif);letter-spacing:.18em;color:#fff2d2;user-select:all}
body.desktop-game .cs-muted,.cs-hint,.cs-status,.cs-warn,.cs-msg{margin:0;font:400 max(var(--uk-min,12px),calc(var(--pg-u)*1.5))/1.5 var(--uk-sans);color:#a8b3b9}
body.desktop-game .cs-status{color:#ede7d8;display:flex;align-items:center;gap:8px}
body.desktop-game .cs-dot{width:10px;height:10px;border-radius:50%;flex:none;background:#6fd36f;box-shadow:0 0 6px #6fd36f}
body.desktop-game .cs-dot.is-offline{background:none;box-shadow:inset 0 0 0 2px #a8b3b9}
body.desktop-game .cs-dot.is-syncing{background:none;box-shadow:inset 0 0 0 2px #e8c45a}
body.desktop-game .cs-dot.is-error{background:#e0584a;box-shadow:0 0 6px #e0584a}
body.desktop-game .cs-hint.is-ok{color:#8fe08f}body.desktop-game .cs-hint.is-bad,body.desktop-game .cs-msg.is-bad{color:#ff9c8c}
body.desktop-game .cs-warn{color:#f6e2a8}
body.desktop-game .cs-msg{min-height:1.5em;text-align:center;color:#d9c9a0}
body.desktop-game .cs-ranks,body.desktop-game .cs-backups{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:calc(var(--pg-u)*.6)}
body.desktop-game .cs-ranks li{display:grid;grid-template-columns:calc(var(--pg-u)*3.4) calc(var(--pg-u)*14) 1fr;align-items:center;gap:calc(var(--pg-u)*.8);font:400 max(var(--uk-min,12px),calc(var(--pg-u)*1.5))/1.3 var(--uk-sans)}
body.desktop-game .cs-ranks img{width:calc(var(--pg-u)*3.4);height:calc(var(--pg-u)*3.4);object-fit:contain}
body.desktop-game .cs-ranks span{color:#d9c9a0;font-family:var(--uk-serif);font-weight:700}
body.desktop-game .cs-ranks b{color:#fff2d2;font-weight:400;min-width:0}
body.desktop-game .cs-backups li{display:flex;align-items:center;gap:calc(var(--pg-u)*1);flex-wrap:wrap;font:400 max(var(--uk-min,12px),calc(var(--pg-u)*1.5))/1.3 var(--uk-sans)}
body.desktop-game .cs-backup-when{color:#fff2d2}
body.desktop-game .cs-backup-sum{color:#a8b3b9;flex:1}

/* Result page rank badge: lives inside the 1600×1000 result board (board px), right of the stage plaque.
   Art keeps its proportions: winged medal 640×597 (avatar socket ⌀234 at 321,260; rank ribbon centre y≈81%),
   「新纪录」 burst 800×658 (ribbon text band x 22–78 %, centre y≈53 %). Shown far below native size. */
body.desktop-game .pg-result-cloud{position:absolute;right:40px;top:calc(150px - var(--dy,0px));z-index:6;display:flex;align-items:center;gap:6px;max-width:470px;box-sizing:border-box;filter:drop-shadow(0 8px 14px #000c)}
body.desktop-game .pg-result-cloud[hidden]{display:none}
body.desktop-game .cs-medal{position:relative;flex:none;width:176px;aspect-ratio:640/597}
body.desktop-game .cs-medal-art{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
body.desktop-game .cs-medal-face{position:absolute;left:32.9%;top:25.05%;width:34.5%;height:37%;border-radius:50%;object-fit:cover}
body.desktop-game .cs-medal-rank{position:absolute;left:24%;right:24%;top:81%;transform:translateY(-50%);text-align:center;font:700 19px/1 var(--uk-serif);color:#fff2d2;letter-spacing:.06em;white-space:nowrap;text-shadow:0 1px 2px #000,0 0 6px #0a1a33}
body.desktop-game .cs-rank-side{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0}
body.desktop-game .cs-burst{position:relative;width:200px;aspect-ratio:800/658;flex:none;margin:-18px 0 -14px}
body.desktop-game .cs-burst img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
body.desktop-game .cs-burst b{position:absolute;left:22%;right:22%;top:53%;transform:translateY(-50%);text-align:center;font:700 22px/1 var(--uk-serif);letter-spacing:.2em;color:#fff4e6;text-shadow:0 1px 2px #5a0a10,0 0 6px #8e1a10}
body.desktop-game .cs-rank-wait{font:400 20px/1.3 var(--uk-sans);color:#d9c9a0;text-shadow:0 1px 3px #000}
body.desktop-game .cs-rank-lines{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
body.desktop-game .cs-rank-line{font:700 21px/1.2 var(--uk-serif);color:#fff2d2;white-space:nowrap;text-shadow:0 1px 2px #000,0 0 8px #000}
body.desktop-game .cs-rank-line.is-up b{color:#ffe7a0}

/* ---------------- 手机版（窗口 < 1000px 的旧单页）：恢复码弹框、「暂时离线游玩」、顶栏头像按钮、资料卡 ----------------
   电脑版（≥ 1000px，body.desktop-game）一律不受影响：下面的规则要么在 max-width:999.98px 里，要么限定 body:not(.desktop-game)。 */
.rc-banner .rc-banner-go{width:auto;height:32px;padding:0 12px;border-radius:6px;background:#d4b477;color:#2a1a08;font:700 14px/1 "Noto Sans SC","Microsoft YaHei",sans-serif;white-space:nowrap}
@media (max-width:999.98px){
  /* 恢复码：整码一行放得下（不再被裁掉首字符），「复制」换到下一行。 */
  .rc-code{flex-wrap:wrap;gap:10px 12px;max-width:100%}
  .rc-code b{max-width:100%;box-sizing:border-box;padding:8px 12px;font-size:clamp(20px,7.2vw,30px);letter-spacing:.14em;text-indent:.14em}
  .rc-code .rc-btn{--h:44px;min-width:0}
  .rc-panel{padding:clamp(14px,2.4vh,26px) clamp(12px,3vw,30px)}
  .rc-banner{top:max(8px,env(safe-area-inset-top));gap:10px;padding:8px 8px 8px 12px;font-size:13px}
}
.cs-mchip{display:none}
body:not(.desktop-game) .cs-mchip{position:relative;flex:none;display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:radial-gradient(circle,#1a2b40,#07101b);box-shadow:0 0 0 2px #d4b477;color:#f1d896;cursor:pointer}
body:not(.desktop-game) .cs-mchip[hidden]{display:none}
body:not(.desktop-game) .cs-mchip:disabled{opacity:.6}
body:not(.desktop-game) .cs-mchip-ava{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover}
body:not(.desktop-game) .cs-mchip-text{font:700 12px/1 "Noto Sans SC","Microsoft YaHei",sans-serif;letter-spacing:.04em}
body:not(.desktop-game) .cs-mchip-dot{position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;background:#6fd36f;box-shadow:0 0 0 2px #101416}
body:not(.desktop-game) .cs-mchip.is-syncing .cs-mchip-dot{background:#e8c45a}
body:not(.desktop-game) .cs-mchip.is-offline .cs-mchip-dot{background:#a8b3b9}
body:not(.desktop-game) .cs-mchip.is-error .cs-mchip-dot{background:#e0584a}
body:not(.desktop-game) .cs-mchip.is-later{box-shadow:0 0 0 2px #a8b3b9}

/* 资料卡（cloud-ui.mjs 的同一张卡，手机排版）：单列、可滚动、按钮 ≥ 40px。 */
body:not(.desktop-game) dialog.cs-profile{width:min(560px,calc(100vw - 16px));max-height:calc(100dvh - 16px);box-sizing:border-box;margin:auto;padding:0;border:1px solid #d0ad764d;border-radius:8px;background:linear-gradient(140deg,#253032,#141a1e);color:#ede7d8;overflow:auto;overscroll-behavior:contain;box-shadow:0 20px 100px #0008;font:400 14px/1.5 "Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif}
body:not(.desktop-game) dialog.cs-profile::backdrop{background:#04090dcc}
body:not(.desktop-game) .cs-profile .cs-card{display:flex;flex-direction:column;gap:12px;padding:14px max(14px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}
body:not(.desktop-game) .cs-profile .cs-head{position:sticky;top:-14px;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:-14px -14px 0;padding:6px 6px 6px 16px;background:#202a2cf2;border-bottom:1px solid #d0ad7633}
body:not(.desktop-game) .cs-profile .uk-plaque{margin:0;font:600 20px/1.4 "Noto Serif SC",serif;letter-spacing:.12em;color:#f1d896}
body:not(.desktop-game) .cs-profile .uk-round{flex:none;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:none;color:#d8d2bf;font:300 28px/1 sans-serif;cursor:pointer}
body:not(.desktop-game) .cs-profile .cs-cols{display:flex;flex-direction:column;gap:12px}
body:not(.desktop-game) .cs-profile .cs-col{display:flex;flex-direction:column;gap:14px;min-width:0;padding:12px;border:1px solid #ffffff14;border-radius:6px;background:#0d151a8c}
body:not(.desktop-game) .cs-profile .cs-block h3{margin:0 0 6px;font:600 15px/1.3 "Noto Serif SC",serif;letter-spacing:.1em;color:#f1d896}
body:not(.desktop-game) .cs-profile .cs-who{display:flex;align-items:center;gap:14px}
body:not(.desktop-game) .cs-profile .cs-ava{flex:none;width:72px;height:72px;padding:0;border:0;border-radius:50%;background:#07101b;box-shadow:0 0 0 3px #d4b477,0 6px 14px #000b;cursor:pointer}
body:not(.desktop-game) .cs-profile .cs-ava img,body:not(.desktop-game) .cs-profile .cs-ava-pick img{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover}
body:not(.desktop-game) .cs-profile :is(.cs-who-text,.cs-rename){display:flex;flex-direction:column;gap:8px;min-width:0;flex:1}
body:not(.desktop-game) .cs-profile .cs-name{font:600 20px/1.2 "Noto Serif SC",serif;color:#fff2d2;letter-spacing:.06em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body:not(.desktop-game) .cs-profile .cs-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
body:not(.desktop-game) .cs-profile .uk-btn{min-height:40px;padding:0 14px;border:1px solid #d0ad7666;border-radius:4px;background:#d0ad7612;color:#e6cf9f;font:500 14px/1 "Noto Sans SC","PingFang SC",sans-serif;letter-spacing:.06em;white-space:nowrap;cursor:pointer}
body:not(.desktop-game) .cs-profile .uk-btn--primary{background:linear-gradient(100deg,#baa06d,#dec695);border-color:#e0c89a;color:#20241f}
body:not(.desktop-game) .cs-profile .uk-btn--red{background:#7a2c24;border-color:#e0584a;color:#ffe6dc}
body:not(.desktop-game) .cs-profile .uk-btn:disabled{opacity:.45;cursor:default}
body:not(.desktop-game) .cs-profile .cs-input{min-width:0;width:100%;height:44px;box-sizing:border-box;padding:0 12px;border:1px solid #c9a25a99;border-radius:6px;background:#050b13;color:#fff4dc;font:600 16px/1 "Noto Sans SC",sans-serif;outline:none}
body:not(.desktop-game) .cs-profile .cs-input:focus{border-color:#f1d896;box-shadow:0 0 0 2px #f1d89655}
body:not(.desktop-game) .cs-profile .cs-code-input{flex:1;width:auto;text-transform:uppercase;letter-spacing:.18em;font-family:"Noto Serif SC",serif}
body:not(.desktop-game) .cs-profile .cs-avatars{display:flex;flex-wrap:wrap;justify-content:center;gap:12px}
body:not(.desktop-game) .cs-profile .cs-ava-pick{width:52px;height:52px;padding:0;border:0;border-radius:50%;background:#07101b;box-shadow:0 0 0 2px #8a6a32;cursor:pointer}
body:not(.desktop-game) .cs-profile .cs-ava-pick.is-picked{box-shadow:0 0 0 3px #f1d896,0 0 14px #ffd27acc}
body:not(.desktop-game) .cs-profile .cs-code{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
body:not(.desktop-game) .cs-profile .cs-code b{max-width:100%;box-sizing:border-box;padding:8px 12px;border-radius:6px;background:#050b13;box-shadow:inset 0 0 0 1px #c9a25a99;font:700 clamp(20px,6.6vw,26px)/1 "Noto Serif SC",serif;letter-spacing:.16em;color:#fff2d2;user-select:all;white-space:nowrap}
body:not(.desktop-game) .cs-profile :is(.cs-muted,.cs-hint,.cs-status,.cs-warn,.cs-msg){margin:0;font:400 13px/1.55 "Noto Sans SC","PingFang SC",sans-serif;color:#a8b3b9}
body:not(.desktop-game) .cs-profile .cs-status{display:flex;align-items:center;gap:8px;color:#ede7d8}
body:not(.desktop-game) .cs-profile .cs-dot{flex:none;width:10px;height:10px;border-radius:50%;background:#6fd36f;box-shadow:0 0 6px #6fd36f}
body:not(.desktop-game) .cs-profile .cs-dot.is-offline{background:none;box-shadow:inset 0 0 0 2px #a8b3b9}
body:not(.desktop-game) .cs-profile .cs-dot.is-syncing{background:none;box-shadow:inset 0 0 0 2px #e8c45a}
body:not(.desktop-game) .cs-profile .cs-dot.is-error{background:#e0584a;box-shadow:0 0 6px #e0584a}
body:not(.desktop-game) .cs-profile .cs-hint.is-ok{color:#8fe08f}
body:not(.desktop-game) .cs-profile :is(.cs-hint.is-bad,.cs-msg.is-bad){color:#ff9c8c}
body:not(.desktop-game) .cs-profile .cs-warn{color:#f6e2a8}
body:not(.desktop-game) .cs-profile .cs-msg{min-height:1.5em;text-align:center;color:#d9c9a0}
body:not(.desktop-game) .cs-profile :is(.cs-ranks,.cs-backups){list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
body:not(.desktop-game) .cs-profile .cs-ranks li{display:grid;grid-template-columns:28px auto;align-items:center;gap:2px 8px;font-size:13px}
body:not(.desktop-game) .cs-profile .cs-ranks img{grid-row:span 2;width:28px;height:28px;object-fit:contain}
body:not(.desktop-game) .cs-profile .cs-ranks span{color:#d9c9a0;font-weight:600}
body:not(.desktop-game) .cs-profile .cs-ranks b{color:#fff2d2;font-weight:400;min-width:0}
body:not(.desktop-game) .cs-profile .cs-backups li{display:flex;align-items:center;gap:4px 10px;flex-wrap:wrap;font-size:13px}
body:not(.desktop-game) .cs-profile .cs-backup-when{color:#fff2d2}
body:not(.desktop-game) .cs-profile .cs-backup-sum{color:#a8b3b9;flex:1}
/* 手机顶栏不论放几个按钮（界隙、头像、音效、语言、?）都不把整页撑宽：按钮区不缩，品牌字（符境 / TOWER OF ARCANA）在放不下时才被裁，菱形标始终在。
   放得下时两边仍是 space-between，外观不变。 */
@media (max-width:650px){
  body:not(.desktop-game) .topbar{gap:8px}
  body:not(.desktop-game) .topbar .brand{min-width:0;flex:0 1 auto}
  body:not(.desktop-game) .topbar .brand>span:last-child{min-width:0;overflow:hidden}
  body:not(.desktop-game) .topbar .header-tools{flex:none}
}
/* polish 10/19：窄手机（≤ 440px）顶栏放了「来客」+ 头像 + 三个图标后，品牌字被裁（390 中文「TOWER OF ARCAN」，英文 360 只剩菱形标）。
   按钮区收紧（图标按钮 44→36 宽、高仍 44；按钮间距 2→0，只在「来客」和头像金圈之间留 3px；「来客」内边距 12→9），副标题字距收到 1px（与「符 境」同宽量级）；
   英文标题更宽：< 400 时标题 17px、「Visitors」12px、图标 34 宽，< 370 时标题 15px；中文 < 345 才收副标题；英文 < 360 只留菱形标。任何宽度都不裁半个字。 */
@media (max-width:440px){
  body:not(.desktop-game) .topbar{gap:6px}
  body:not(.desktop-game) .topbar .brand{gap:5px}
  body:not(.desktop-game) .topbar .brand small{letter-spacing:1px}
  body:not(.desktop-game) .topbar .header-tools{gap:0}
  body:not(.desktop-game) .topbar .header-tools #ow-entry{padding:0 9px;margin-right:3px}
  body:not(.desktop-game) .topbar .icon-button{width:36px}
}
@media (max-width:399.98px){
  html.i18n-en body:not(.desktop-game) .topbar .brand>span:last-child{font-size:17px}
  html.i18n-en body:not(.desktop-game) .topbar .brand small{letter-spacing:.9px}
  html.i18n-en body:not(.desktop-game) .topbar .header-tools #ow-entry{padding:0 8px;font-size:12px}
  html.i18n-en body:not(.desktop-game) .topbar .icon-button{width:34px}
}
@media (max-width:369.98px){
  html.i18n-en body:not(.desktop-game) .topbar .brand>span:last-child{font-size:15px}
  html.i18n-en body:not(.desktop-game) .topbar .brand small{letter-spacing:.4px}
  html.i18n-en body:not(.desktop-game) .topbar .icon-button{width:33px}
}
@media (max-width:344.98px){
  body:not(.desktop-game) .topbar .brand small{display:none}
  body:not(.desktop-game) .topbar .brand>span:last-child{font-size:17px}
}
/* 最窄的手机（< 360px，例如 320px 宽）：顶栏多了「界隙」和头像按钮后会比屏幕宽 27px，整页出现横向溢出（资料卡、棋盘跟着偏）。收紧间距即可放下。 */
@media (max-width:359.98px){
  body:not(.desktop-game) .topbar{gap:8px}
  body:not(.desktop-game) .topbar .header-tools #ow-entry{padding:0 8px}
  body:not(.desktop-game) .topbar .icon-button{width:34px}
  body:not(.desktop-game) .topbar .brand>span:last-child:lang(en){display:none}
}

/* 流畅度第三轮（评审「立刻改」6c）：没输名字前「开始冒险」是禁用态，字也要看得清。 */
.rc-btn:disabled{color:#e6e1d6;text-shadow:0 1px 2px #000d,0 0 6px #0009}

/* ---------------- 外观（riftshop 10/19，dist/cosmetics.mjs）：头像框叠在头像上、称号牌。电脑 / 手机共用 ----------------
   .lk-ava 包住原来的头像 <img>（各处原有的尺寸类不变），框图按圆洞比例 --lk-hole 放大到「头像 ÷ 圆洞」并居中，超出部分不占位置。
   各处想让带框的头像整体不超过某个尺寸时，把头像设成「框的尺寸 × var(--lk-hole)」。 */
.lk-ava{position:relative;display:inline-block;flex:none;line-height:0;vertical-align:middle}
.lk-ava>img:not(.lk-frame){box-shadow:none!important;border-color:transparent!important}
.lk-ava>img.lk-frame{position:absolute!important;left:50%!important;top:50%!important;width:calc(100% / var(--lk-hole,.6))!important;height:calc(100% / var(--lk-hole,.6))!important;max-width:none!important;max-height:none!important;margin:0!important;transform:translate(-50%,-50%);border:0!important;border-radius:0!important;box-shadow:none!important;background:none!important;object-fit:contain!important;pointer-events:none;z-index:1;filter:drop-shadow(0 1px 2px #0009)}
.lk-ava.is-oath>img.lk-frame{filter:drop-shadow(0 0 2px #ffe08a) drop-shadow(0 0 6px #e8b13acc)}
.lk-ava.is-fusion>img.lk-frame{filter:drop-shadow(0 0 2px #d6c2ff) drop-shadow(0 0 6px #8f6bffcc)}
.lk-face{display:block;border-radius:50%;object-fit:cover;background:#07101b}

.lk-title{--lk-p:#4a3d22;--lk-a:#c9a25a;position:relative;display:inline-flex;align-items:center;gap:.3em;max-width:100%;min-width:0;box-sizing:border-box;padding:.2em .75em .2em .3em;border-radius:.35em;
  background:#1d2530;background:linear-gradient(180deg,color-mix(in srgb,var(--lk-p) 62%,#0a0f16),color-mix(in srgb,var(--lk-p) 30%,#05080d));
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--lk-a) 75%,#fff 10%),inset 0 1px 0 #ffffff26,0 1px 3px #000b;color:#fff1cf;font:700 13px/1.15 var(--uk-serif,"Noto Serif SC",serif);letter-spacing:.06em;white-space:nowrap;vertical-align:middle;text-shadow:0 1px 1px #000c}
.lk-title::after{content:"";position:absolute;inset:2px;border-radius:.25em;border:1px solid color-mix(in srgb,var(--lk-a) 35%,transparent);pointer-events:none}
.lk-title>b{min-width:0;overflow:hidden;text-overflow:ellipsis;font-weight:700}
.lk-emblem{flex:none;width:1.55em;height:1.55em;margin:-.25em 0;background:var(--lk-em) center/contain no-repeat;filter:drop-shadow(0 1px 1px #000b)}
.lk-emblem.is-star{display:grid;place-items:center;width:1.3em;height:1.3em;margin:0;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff6d0,#d9a93c 60%,#7a5414);color:#3a2410;font:700 .8em/1 sans-serif;font-style:normal;text-shadow:none}
.lk-title.is-oath{box-shadow:inset 0 0 0 1px #ffe39a,inset 0 1px 0 #fff4,0 0 7px #e8b13a99;color:#fff6d8}
.lk-title.is-milestone{--lk-p:#2c3d63;--lk-a:#a9c7ff}
.lk-title.is-xs{font-size:11px;padding:.15em .6em .15em .25em}
.lk-title.is-sm{font-size:12.5px}
.lk-title.is-lg{font-size:17px;padding:.3em .9em .3em .35em}

/* 「我的资料」一格：外观（电脑与手机同一张卡） */
.lk-wear h4{margin:.7em 0 .35em;font:700 12px/1.2 var(--uk-serif,"Noto Serif SC",serif);letter-spacing:.12em;color:#d9c9a0}
.lk-picks{display:flex;flex-wrap:wrap;gap:6px;max-height:156px;overflow:auto;padding:2px}
.lk-pick{display:inline-grid;place-items:center;min-height:36px;min-width:36px;padding:3px 5px;border:1px solid #c9a25a44;border-radius:6px;background:#050b1399;color:#d9c9a0;cursor:pointer;transition:border-color .15s ease,background .15s ease}
.lk-pick:hover{border-color:#c9a25acc}
.lk-pick.is-on{border-color:#f1d896;background:#3a2c1066;box-shadow:0 0 0 1px #f1d896,0 0 10px #ffd27a55}
.lk-pick:focus-visible{outline:2px solid #fff;outline-offset:2px}
.lk-pick.is-frame{width:48px;height:48px;padding:0}
.lk-pick.is-frame .lk-face{width:calc(44px * var(--lk-hole,.6));height:calc(44px * var(--lk-hole,.6))}
.lk-none{font:400 12px/1 var(--uk-sans,sans-serif);color:#a8b3b9;white-space:nowrap}
@media (prefers-reduced-motion:reduce){.lk-pick{transition:none}}

/* 顶栏小牌（电脑）与手机顶栏头像：带框时框的外径固定，头像按圆洞缩。 */
body.desktop-game .cs-chip .lk-ava>.cs-chip-ava{width:calc(var(--ds-header,58px)*.84*var(--lk-hole));height:calc(var(--ds-header,58px)*.84*var(--lk-hole))}
body.desktop-game .cs-chip .cs-chip-look{margin:0 calc(var(--ds-header,58px)*.84*(1 - var(--lk-hole))/2) 0 calc(var(--ds-header,58px)*.84*(1 - var(--lk-hole))/2 - 4px)}
body:not(.desktop-game) .cs-mchip>.lk-ava>.cs-mchip-ava{width:calc(44px * var(--lk-hole));height:calc(44px * var(--lk-hole))}
body:not(.desktop-game) .cs-mchip:has(.lk-ava) .cs-mchip-dot{z-index:2}
body:not(.desktop-game) .cs-mchip:has(.lk-ava){background:none;box-shadow:none}
/* 资料卡头像 */
body.desktop-game .cs-ava.is-framed{width:calc(var(--pg-u)*14);height:calc(var(--pg-u)*14);display:grid;place-items:center;background:none;box-shadow:none}
body.desktop-game .cs-ava.is-framed .lk-ava{width:calc(100% * var(--lk-hole));height:calc(100% * var(--lk-hole))}
body:not(.desktop-game) .cs-profile .cs-ava.is-framed{width:92px;height:92px;display:grid;place-items:center;background:none;box-shadow:none}
body:not(.desktop-game) .cs-profile .cs-ava.is-framed .lk-ava{width:calc(100% * var(--lk-hole));height:calc(100% * var(--lk-hole))}
body.desktop-game .cs-name-title{align-self:flex-start;font-size:max(12px,calc(var(--pg-u)*1.6))}
body:not(.desktop-game) .cs-name-title{align-self:flex-start}
body.desktop-game .lk-wear h4{font-size:max(12px,calc(var(--pg-u)*1.45))}
body.desktop-game .lk-pick.is-frame{width:calc(var(--pg-u)*6.4);height:calc(var(--pg-u)*6.4)}
body.desktop-game .lk-pick.is-frame .lk-face{width:calc(var(--pg-u)*5.8*var(--lk-hole,.6));height:calc(var(--pg-u)*5.8*var(--lk-hole,.6))}
/* 拥有得多时两排列表各自在框里上下滚（资料卡在 1366×768 也不出屏）。 */
body.desktop-game .lk-picks{max-height:calc(var(--pg-u)*11.5)}
body.desktop-game .lk-picks.is-frames{max-height:calc(var(--pg-u)*8.6)}
/* mobile16pm A4（iPhone 16 Pro Max 430×932）：首次建号「我已经有恢复码」、资料卡里「借给朋友」的选择框都做到 44px 高；
   「我的名次」每一行可以点（打开手机排行榜的那一张榜），下面一个「查看排行榜」。 */
@media (max-width:999.98px){
  body:not(.desktop-game) .rc-first .rc-link{min-height:44px;padding:10px 12px}
  body:not(.desktop-game) .cs-profile .hp-lend select{min-height:44px;font-size:14px}
  body:not(.desktop-game) .cs-profile .cs-ranks li{display:block}
  body:not(.desktop-game) .cs-profile .cs-rank-link{display:grid;grid-template-columns:32px minmax(0,1fr) 16px;grid-template-areas:"icon label go" "icon text go";align-items:center;gap:0 10px;width:100%;min-height:52px;margin:0;padding:6px 8px;box-sizing:border-box;border:1px solid #d4b47733;border-radius:10px;background:#0e171f;color:inherit;font:inherit;font-size:13px;text-align:left;cursor:pointer}
  body:not(.desktop-game) .cs-profile .cs-rank-link img{grid-area:icon;grid-row:auto;width:32px;height:32px}
  body:not(.desktop-game) .cs-profile .cs-rank-link span{grid-area:label}
  body:not(.desktop-game) .cs-profile .cs-rank-link b{grid-area:text}
  body:not(.desktop-game) .cs-profile .cs-rank-link i{grid-area:go;font-style:normal;font-size:20px;color:#d4b477aa}
  body:not(.desktop-game) .cs-profile .cs-board-open{width:100%;margin-top:8px}
  body:not(.desktop-game) .cs-profile .uk-btn--sm{min-height:44px}
}
