/* Entry portal: account → server → character. Uses the game's palette tokens from style.css. */
.portal{position:fixed;inset:0;z-index:200;display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;padding:32px 16px;background:#041315;color:var(--ink)}
.portal[hidden]{display:none!important}
body.portal-open{overflow:hidden}
.portal-backdrop{position:fixed;inset:0;background:linear-gradient(#041315cc,#041315f2 70%),url('/assets/original/first_res/createrole/cj_ditu_01.jpg') center/cover no-repeat;pointer-events:none}
.portal-shell{position:relative;width:100%;max-width:520px;display:flex;flex-direction:column;gap:16px}
.portal-head{display:flex;align-items:center;gap:14px}
.portal-head img{width:46px;height:46px}
.portal-head h1{margin:0;font:30px "PMingLiU",serif;letter-spacing:8px;color:#ecd195}
.portal-head p{margin:2px 0 0;font-size:12px;letter-spacing:1px;color:var(--muted)}
.portal-steps{display:flex;gap:6px;margin:0;padding:0;list-style:none;font-size:12px;color:var(--muted)}
.portal-steps li{flex:1;display:flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid var(--line);border-radius:6px;background:#0a2224b3}
.portal-steps li span{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;border:1px solid currentColor;font-size:10px}
.portal-steps li.current{color:var(--gold);border-color:#dfc17c66}
.portal-steps li.done{color:var(--jade)}
.portal-card{background:linear-gradient(#10272aee,#0a1f21f2);border:1px solid var(--line);border-radius:10px;padding:20px;box-shadow:0 18px 40px #0008}
.portal-card-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.portal-card-head h2{margin:0;flex:1;font-size:18px;color:#f0dfb1;font-weight:600}
.portal-user{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:8px}
.portal-form{display:flex;flex-direction:column;gap:6px}
.portal-form label,.portal-new label{font-size:12px;color:#b9c9b3;margin-top:8px}
.portal input{width:100%;min-height:42px;padding:9px 12px;border-radius:6px;border:1px solid #b8b37b55;background:#061718;color:var(--ink);font:inherit;font-size:15px}
.portal input:focus-visible,.portal button:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.portal-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:6px}
.portal-tabs button{min-height:40px;border-radius:6px;border:1px solid var(--line);background:transparent;color:var(--muted);font:inherit;cursor:pointer}
.portal-tabs button.active{color:#1b1406;background:var(--gold);border-color:var(--gold);font-weight:600}
.portal-primary,.portal-secondary{min-height:42px;padding:0 18px;border-radius:6px;font:inherit;font-weight:600;cursor:pointer;white-space:nowrap}
.portal-primary{border:1px solid #f0d99a;background:linear-gradient(#ecd195,#c9a65a);color:#2a1d08}
.portal-secondary{border:1px solid var(--line);background:#0c2729;color:var(--ink)}
.portal-form .portal-primary{margin-top:14px}
.portal button:disabled{opacity:.55;cursor:wait}
.portal-link{border:0;background:none;color:var(--jade);font:inherit;font-size:13px;cursor:pointer;padding:6px 2px;min-height:32px}
.portal-hint{margin:8px 0 0;font-size:12px;color:var(--muted)}
.portal-notice{margin:0;padding:10px 12px;border-radius:6px;background:#173a33;border:1px solid #7bddc155;color:#cdeee3;font-size:13px}
.portal-error{margin:0;min-height:1em;color:var(--red);font-size:13px}
.portal-error:empty{display:none}
.portal-foot{font-size:11px;color:#6f8a85;text-align:center}
.portal-wait{display:flex;flex-direction:column;align-items:center;gap:12px;color:var(--muted)}
.portal-spinner{width:28px;height:28px;border-radius:50%;border:2px solid #7bddc133;border-top-color:var(--jade);animation:portal-spin 1s linear infinite}
@keyframes portal-spin{to{transform:rotate(360deg)}}
.portal-worlds,.portal-chars{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.portal-world{width:100%;display:grid;grid-template-columns:auto 1fr auto;grid-template-areas:"dot name mine" "dot meta mine";align-items:center;column-gap:12px;row-gap:2px;padding:14px;border-radius:8px;border:1px solid var(--line);background:#0b2325;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.portal-world:hover:not(:disabled){border-color:#dfc17c88;background:#10302f}
.portal-world-name{grid-area:name;font-size:16px;font-weight:600}
.portal-world-name em{margin-left:8px;padding:1px 6px;border-radius:4px;background:#dfc17c22;color:var(--gold);font-size:11px;font-style:normal}
.portal-world-meta{grid-area:meta;font-size:12px;color:var(--muted)}
.portal-world-mine{grid-area:mine;font-size:12px;color:#b9c9b3}
.portal-dot{grid-area:dot;width:10px;height:10px;border-radius:50%}
.portal-dot.smooth{background:#6fd59a}.portal-dot.busy{background:#e3b45c}.portal-dot.full{background:var(--red)}.portal-dot.maint{background:#6b7d7a}
.portal-char{display:grid;grid-template-columns:64px 1fr auto;align-items:center;gap:12px;padding:10px 12px;border-radius:8px;border:1px solid var(--line);background:#0b2325}
.portal-char img{width:64px;height:64px;object-fit:cover;object-position:center 20%;border-radius:6px;background:#122f2c}
.portal-char>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.portal-char strong{font-size:16px;color:#f0dfb1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.portal-char span{font-size:12px;color:var(--muted)}
.portal-char em{font-size:11px;font-style:normal;color:var(--gold)}
.portal-new{display:block}
.portal-new form{display:flex;flex-direction:column;gap:6px}
.portal-new label{margin-top:0}
.portal-name-row{display:flex;flex-direction:row;flex-wrap:nowrap;gap:8px}.portal-name-row input{flex:1 1 auto;min-width:0;width:auto}.portal-name-row .portal-secondary{flex:0 0 auto;width:auto}
@media(max-width:480px){.portal{padding:20px 16px}.portal-card{padding:16px}.portal-char{grid-template-columns:52px 1fr}.portal-char img{width:52px;height:52px}.portal-char .portal-primary{grid-column:1 / -1;width:100%}.portal-steps{font-size:11px}.portal-steps li{padding:6px}}
@media(prefers-reduced-motion:reduce){.portal-spinner{animation:none}}
/* Other players in the shared field */
.rt-unit.rt-other .rt-name{color:#a9e6ff}
.rt-unit.rt-other .rt-health i{background:linear-gradient(90deg,#5fb6d6,#9fe0f2)}
.rt-unit.rt-other .rt-sprite{filter:hue-rotate(160deg) saturate(.8)}
.rt-field-badge{position:absolute;right:8px;bottom:8px;z-index:6;padding:3px 8px;border-radius:4px;background:#041315b3;border:1px solid #7bddc144;color:#bfe9dc;font-size:11px;pointer-events:none}
.rt-number.rt-number-ally{opacity:.7;transform:scale(.82)}

/* P21.4: compact account entry; retain world and character navigation. */
.portal{padding:clamp(24px,8vh,80px) 18px;align-items:flex-start}
.portal-backdrop{background:linear-gradient(110deg,#071919ed,#071919bb),url('/assets/original/first_res/createrole/cj_ditu_01.jpg') center/cover no-repeat}
.portal-shell{max-width:480px}
.portal-auth-shell{max-width:360px;gap:20px}
.portal-auth-shell .portal-head{justify-content:center;text-align:center}
.portal-auth-shell .portal-head img{display:none}
.portal-auth-shell .portal-head h1{font-size:32px;letter-spacing:6px}
.portal-auth-shell .portal-head p{margin-top:10px;letter-spacing:0}
.portal-auth-shell .portal-steps{display:none}
.portal-auth-shell .portal-card{background:#102426f5;border-color:#ffffff18;border-radius:14px;box-shadow:0 16px 48px #0004;padding:24px}
.portal-auth-shell .portal-form{position:relative;padding-bottom:74px;gap:8px}
.portal-auth-shell .portal-tabs{position:absolute;bottom:18px;left:24px;right:24px;display:flex;justify-content:center;gap:20px;margin:0}
.portal-auth-shell .portal-tabs button{border:0;background:none;color:#b6c7bf;font-size:13px;min-height:32px;padding:0}
.portal-auth-shell .portal-tabs button.active{display:none}
.portal-auth-shell .portal-form input{min-height:46px;border-color:#ffffff26}
.portal-auth-shell .portal-primary{min-height:46px;margin-top:16px}
.portal-auth-shell .portal-hint:empty{display:none}
.portal-auth-shell .portal-foot{margin:0}
@media(max-width:480px){.portal{padding:32px 18px}.portal-auth-shell .portal-card{padding:22px;padding-bottom:72px}}
