:root {
  color-scheme: dark;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 13px;
  color: #dce5ef;
  background: #080c13;
  --orange: #ff941f;
  --teal: #43cdbf;
  --line: #2b394c;
  --muted: #8898ad;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; min-width: 1100px; padding: 8px; display: grid; grid-template-rows: 62px minmax(0, 1fr) 62px; gap: 8px; }
button, input, select { font: inherit; color: inherit; background: #111a29; border: 1px solid #354359; border-radius: 4px; padding: 8px 12px; min-width: 0; }
button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; cursor: pointer; font-weight: 700; white-space: nowrap; box-shadow: inset 0 1px #ffffff08; transition: background .15s, border-color .15s; }
button:hover { border-color: var(--orange); background: #243144; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: default; }
button:disabled:hover { border-color: #354359; background: #111a29; }
.orange { color: white; background: #e97606; border-color: #ffa438; box-shadow: inset 0 1px #ffc67955; }
.orange:hover { background: #ff8a13; }
.green { color: white; background: #009e89; border-color: #2cd7bd; }
.green:hover { background: #0bb69e; }
.quick { color: #f2cb5f; }
.icon { width: 16px; height: 16px; flex: 0 0 auto; display: inline-block; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; align-items: center; flex-shrink: 0; }
.icon-button { width: 35px; padding: 8px; }
.panel { position: relative; min-width: 0; min-height: 0; background: #111824; border: 1px solid var(--line); border-radius: 5px; padding: 12px; box-shadow: 0 2px 6px #0005, inset 0 0 0 3px #ffffff02; }
.panel::before { content: ''; position: absolute; top: -1px; left: 4px; right: 4px; height: 1px; background: linear-gradient(90deg, #f39224 0%, #b78435 50%, #3cc8bc 100%); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.logo { color: #171e27; background: #f48d15; padding: 7px; border: 1px solid #ffb54f; border-radius: 5px; box-shadow: 0 0 16px #fb96101a; }
.logo .icon { width: 28px; height: 28px; stroke-width: 1.5; }
.logo.logo-img { width: 44px; height: 44px; padding: 0; background: none; border: 0; border-radius: 50%; box-shadow: 0 0 16px #fb961033; }
.brand-line { display: flex; align-items: baseline; gap: 10px; }
h1 { font-size: 23px; color: #ffaf44; margin: 0; letter-spacing: 2px; font-style: italic; font-weight: 900; line-height: 1.3; white-space: nowrap; }
.wordmark { font-size: 9px; letter-spacing: 1.2px; color: #a1b3c3; font-family: monospace; white-space: nowrap; }
.status { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #4ccba4; margin-top: 3px; }
.dot { width: 6px; height: 6px; background: #41d6a2; border-radius: 50%; box-shadow: 0 0 6px #41d6a244; }
.server-note { color: #7fc9d9; padding-left: 8px; border-left: 1px solid #334356; margin-left: 4px; }
.actions { display: flex; gap: 7px; align-items: center; }
main { min-height: 0; display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr); grid-template-rows: minmax(0, 1fr) clamp(140px, 17vh, 184px); gap: 8px; }
.rooms { display: flex; flex-direction: column; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 23px; padding-bottom: 10px; }
h2 { display: flex; align-items: center; gap: 7px; font-size: 12px; margin: 0; color: #e5edf7; }
h2 .icon, .count { color: #f3a24b; }
.muted { color: var(--muted); font-size: 10px; }
#list-note { text-align: right; }
.room-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 10px; }
.room-card { background: #141f2e; border: 1px solid #2d3d54; border-left: 3px solid #f28c24; display: flex; flex-direction: column; justify-content: normal; align-items: stretch; text-align: left; padding: 12px; min-height: 0; min-width: 0; border-radius: 5px; box-shadow: inset 0 1px #ffffff03, 0 2px 4px #0002; }
.room-card.busy { border-left-color: #48bbad; }
.room-card:hover { background: #1c2a3c; box-shadow: 0 0 0 1px #f28c2433; }
.card-top, .card-bottom { display: flex; align-items: center; gap: 7px; font-size: 10px; flex-shrink: 0; }
.card-number { color: #ffae57; font-size: 9px; background: #0b1421; padding: 3px 5px; border-radius: 2px; font-family: monospace; }
.badge { background: #114856; color: #74e2e0; padding: 2px 6px; border: 1px solid #196071; border-radius: 3px; font-size: 10px; }
.lock { color: #e7bb54; }
.lock .icon { width: 12px; height: 12px; }
.card-top .state { margin-left: auto; }
.state { color: #5bd7a2; font-size: 10px; white-space: nowrap; }
.state.busy { color: #f5848d; }
.state.practice { color: #edcb63; }
.state.in-room { color: #77c9f5; }
.dot[data-state="connecting"] { background: #edcb63; }
.dot[data-state="offline"] { background: #f5848d; }
.room-card.full { opacity: .6; }
.form-error { color: #f5848d; }
.room-name { margin: auto 0; padding: 8px 0; text-align: center; font-size: clamp(14px, 1.05vw, 20px); font-weight: 700; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.card-bottom { justify-content: space-between; border-top: 1px solid #ffffff05; padding-top: 7px; color: #adbed0; font-family: monospace; }
.card-bottom span { display: inline-flex; gap: 4px; align-items: center; }
.card-bottom .icon { width: 12px; height: 12px; }
.latency { color: #71bda4; }
.empty { grid-area: 1 / 1 / -1 / -1; display: flex; align-items: center; justify-content: center; flex-direction: column; background: #0d1521; border: 1px solid #26364a; color: #91a1b5; gap: 12px; text-align: center; padding: 24px; }
.empty strong { color: #dce5ef; font-size: 20px; }
.empty .icon { width: 48px; height: 48px; color: #c98740; stroke-width: 1; margin-bottom: 6px; }
.room-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; gap: 10px; }
.pager { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #9eafc2; }
.pager button { padding: 4px 9px; font-size: 10px; }
.pager span { padding: 3px 9px; color: #e5a054; background: #0b111c; border: 1px solid #263347; border-radius: 3px; }
.join { display: flex; align-items: center; gap: 7px; padding-top: 10px; margin-top: 9px; border-top: 1px solid #233044; }
.join input { width: 150px; text-transform: uppercase; }
.join input, .join select, .join button { font-size: 11px; padding: 6px 9px; }
.join-label { color: #91a6bb; font-size: 11px; margin-right: auto; display: flex; gap: 6px; align-items: center; }
.join small { color: #6f839a; font-size: 10px; }
.players { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; }
.players h2 { color: #f0a34b; }
.players h2 .icon { color: #43ccca; }
.online-count { font-size: 10px; color: #68cea3; border: 1px solid #213c35; background: #0c171a; border-radius: 3px; padding: 3px 6px; white-space: nowrap; }
.player-list { flex: 1; min-height: 0; background: #0a101b; padding: 6px; border: 1px solid #202d40; display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.player { border: 1px solid #263248; background: #101827; border-radius: 3px; padding: 11px 9px; display: flex; gap: 9px; align-items: center; flex-shrink: 0; }
.player.self { border-color: #79502b; background: #2a1e19; box-shadow: inset 2px 0 #f39227; }
.player.offline { opacity: .65; }
.player.offline .state { color: #a3adba; background: #252d38; border-color: #45505f; }
.avatar { width: 30px; height: 30px; color: #b3c9df; background: #28394d; display: grid; place-items: center; border-radius: 50%; flex-shrink: 0; }
.self .avatar { color: #ffd092; background: #684328; }
.player-identity { min-width: 0; flex: 1; }
.player strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.self strong { color: #ffb363; }
.player-level { color: #7d91aa; font-size: 9px; margin-top: 2px; }
.player-note { padding: 10px 2px; text-align: center; font-size: 9px; }
.players-pager { justify-content: space-between; border-top: 1px solid #222f41; padding-top: 8px; }
.players-pager span { color: #90a0b4; background: transparent; border: 0; }
/* 右欄下半部：角色資訊（玩家名單佔上半） */
.players .player-list { flex: 1 1 0; }
.me-card { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid #222f41; margin-top: 10px; padding-top: 10px; }
.me-card h2 { color: #f0a34b; }
.me-body { flex: 1; min-height: 0; display: flex; gap: 12px; align-items: stretch; background: #0a101b; border: 1px solid #202d40; padding: 8px; }
.me-body img { width: 46%; height: 100%; min-height: 0; object-fit: contain; border-radius: 8px; background: #152236; }
.me-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.me-name { margin: 2px 0 0; font-size: 16px; color: #ffb363; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-title { margin: -4px 0 0; font-size: 12px; color: #c58bff; min-height: 14px; }
.me-lv { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; font-size: 12px; }
.me-lvn { color: #ffd092; font-size: 14px; } .me-exp { grid-column: 2; color: #7d91aa; font-size: 10px; }
.me-bar { height: 7px; background: #1d2a3d; border-radius: 4px; overflow: hidden; } .me-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f39227, #ffd092); }
.me-coins, .me-time { margin: 0; font-size: 12px; color: #d8e2ee; }
.me-stats { width: 100%; border-collapse: collapse; font-size: 11px; } .me-stats th { color: #7d91aa; font-weight: 500; text-align: right; } .me-stats th:first-child { text-align: left; }
.me-stats td { text-align: right; padding: 2px 0; color: #d8e2ee; } .me-stats td:first-child { text-align: left; color: #f0a34b; }
.me-side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12px; }
.me-side dt { color: #7d91aa; } .me-side dd { margin: 0; color: #d8e2ee; }
.me-side button { margin-top: auto; }
#equip-panel { width: 720px; background: #152236; color: #e5edf7; }
.eq-tabs { display: flex; gap: 8px; margin: 6px 0 12px; }
.eq-tabs button[aria-selected="true"] { background: #df8040; color: #101724; border-color: #f7b57e; font-weight: 700; }
.eq-body { display: flex; gap: 18px; align-items: flex-start; }
.eq-body img { width: 220px; height: 275px; object-fit: contain; border-radius: 10px; background: #0f1a2b; flex-shrink: 0; }
.eq-slots { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.eq-row { display: flex; flex-direction: column; gap: 6px; }
.eq-row > span { font-size: 13px; font-weight: 700; color: #ffb363; } .eq-row small { margin-left: 8px; color: #7d91aa; font-weight: 400; }
.eq-items { display: flex; flex-wrap: wrap; gap: 6px; }
.eq-items button { font-size: 12px; padding: 6px 10px; }
.eq-items button:disabled { opacity: .45; cursor: not-allowed; }
.eq-note { font-size: 11px; color: #7d91aa; margin: 0; }
.eq-wheel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .eq-wheel div { background: #0f1a2b; border: 1px solid #2a3a52; border-radius: 8px; padding: 6px; text-align: center; } .eq-wheel small { display: block; color: #7d91aa; font-size: 10px; } .eq-wheel b { font-size: 12px; color: #ffcf9a; }
.eq-items button[aria-pressed="true"] { border-color: #f99528; background: #3a2615; color: #ffcf9a; }
#team-panel { width: 640px; background: #152236; color: #e5edf7; }
.tm-lock { font-size: 14px; color: #c5d2e2; line-height: 1.8; }
.tm-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; } .tm-row b { width: 70px; color: #ffb363; font-size: 13px; } .tm-row input { flex: 1; }
.tm-head { display: flex; align-items: baseline; gap: 14px; } .tm-head h3 { margin: 0; color: #ffd092; font-size: 20px; } .tm-head span { font-size: 12px; color: #9bafc0; } .tm-head b { color: #fff; letter-spacing: 2px; }
.tm-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; margin: 12px 0; } .tm-cols > div > b { font-size: 13px; color: #ffb363; }
.tm-members { list-style: none; padding: 0; margin: 6px 0; max-height: 220px; overflow: auto; font-size: 13px; } .tm-members li { padding: 4px 0; border-bottom: 1px solid #22314a; }
.tm-shirt { width: 90px; height: 70px; margin: 8px 0; border: 5px solid; border-radius: 16px 16px 8px 8px; display: grid; place-items: center; font: 900 30px/1 "Anton", sans-serif; }
.tm-design { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; } .tm-design label { flex-direction: row; margin: 0; align-items: center; gap: 4px; font-size: 12px; } .tm-design input[type=color] { width: 32px; height: 24px; padding: 0; }
.tm-leave { border-color: #a8483f; color: #ffb4a8; }
.me-err { margin: 0; min-height: 14px; font-size: 11px; color: #ff9c8a; }
.chat { display: flex; flex-direction: column; gap: 7px; }
.chat-heading { display: flex; justify-content: space-between; align-items: center; }
.chat-heading h2 { font-size: 10px; color: #94a9bd; }
.chat-heading span { font-size: 9px; color: #758ba2; }
.messages { flex: 1; min-height: 0; overflow: auto; background: #090f1a; border: 1px solid #202c3c; padding: 7px 10px; overflow-wrap: anywhere; scrollbar-width: thin; }
.messages p { margin: 4px 0; font-size: 11px; line-height: 1.5; }
.messages .icon { width: 12px; height: 12px; margin-right: 3px; }
.notice { color: #f6a44d; }
.system { color: #40c1d5; }
.chat form { display: flex; gap: 7px; }
.chat form > * { padding: 6px 9px; font-size: 11px; }
.chat input { flex: 1; min-width: 0; }
footer { display: flex; gap: 8px; align-items: center; padding: 6px 9px !important; }
footer nav { display: flex; gap: 7px; }
footer button { min-height: 44px; font-size: 14px; padding: 8px 14px; white-space: nowrap; }
footer button .icon { width: 18px; height: 18px; color: #e4b350; }
footer [data-soon] .icon { color: #f29c59; }
footer #team-open .icon { color: #40d3d1; }
footer .muted { margin-left: auto; }
dialog { width: 440px; max-height: calc(100dvh - 36px); background: #121d2b; color: #e1e9f2; border: 1px solid #ad702c; border-top: 3px solid #f99528; border-radius: 6px; padding: 27px; box-shadow: 0 20px 100px #000; }
dialog::backdrop { background: #03070cdd; }
dialog h2 { font-size: 24px; color: #ffac53; margin: 9px 0; }
dialog p { color: #9bafc0; line-height: 1.8; font-size: 12px; }
#lobby-news { width: min(620px, calc(100vw - 32px)); padding: clamp(20px, 4vw, 36px); overflow-y: auto; }
#lobby-news h2 { font-size: 29px; }
#lobby-news h3 { font-size: 19px; margin: 22px 0 8px; }
#lobby-news p { font-size: 15px; margin: 8px 0; }
#lobby-news .news-date { font-size: 13px; }
dialog label { display: flex; flex-direction: column; gap: 7px; margin: 17px 0; font-size: 12px; }
dialog .buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.eyebrow { font-size: 9px; letter-spacing: 2px; color: #7895ae; }
.form-note { padding: 9px; border-left: 2px solid #c88740; background: #231f1b; }
#toast { position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%); padding: 12px 24px; max-width: 80vw; background: #16352e; border: 1px solid #49c5ac; border-radius: 4px; z-index: 5; box-shadow: 0 6px 30px #0008; }
#toast[hidden] { display: none; }
@media (max-width: 1450px) {
  :root { font-size: 12px; }
  .wordmark { display: none; }
  .panel { padding: 10px; }
  .room-card { padding: 10px; }
  .join small { display: none; }
  .player { padding: 9px 7px; }
  .avatar { width: 25px; height: 25px; }
}
@media (max-height: 820px) {
  body { grid-template-rows: 56px minmax(0, 1fr) 60px; gap: 7px; }
  main { grid-template-rows: minmax(0, 1fr) 142px; }
  .panel-head { padding-bottom: 7px; }
  .room-grid { gap: 8px; }
  .room-footer { padding-top: 7px; }
  .join { padding-top: 7px; margin-top: 7px; }
  .room-name { padding: 5px 0; }
  .card-bottom { padding-top: 5px; }
  .logo { padding: 5px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

/* 房間清單改扁：卡片兩行（上：房號、模式、狀態；下：房名、人數、延遲），清單只佔需要的高度，剩下給留言板 */
main { grid-template-rows: minmax(0, 1.25fr) minmax(170px, 1fr); }
.room-grid { flex: 1; grid-template-rows: repeat(3, minmax(64px, 84px)); align-content: start; gap: 8px; }
.room-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center; column-gap: 14px; row-gap: 6px; padding: 8px 12px; overflow: hidden; }
.room-card .card-top { grid-column: 1 / 3; }
.room-card .room-name { grid-column: 1; margin: 0; padding: 1px 0 3px; text-align: left; font-size: 15px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-card .card-bottom { grid-column: 2; border: 0; padding: 0; gap: 14px; }
.empty { gap: 6px; }
.empty .icon { width: 28px; height: 28px; margin-bottom: 0; }
.empty strong { font-size: 15px; }

#character-panel { width: 580px; background: #152236; color: #e5edf7; }
.character-info { display: flex; gap: 28px; align-items: center; }
.character-info img { object-fit: contain; border-radius: 12px; }
.character-info dl { display: grid; grid-template-columns: auto auto; gap: 16px 24px; }
.character-info dd { margin: 0; }
/* 整體放大：100% 瀏覽器縮放時，大廳看起來跟 125% 一樣大（字、按鈕、圖片一起放大）。
   zoom 會連 dvh 一起放大，所以高度、最小寬度要除回去；螢幕不夠大時放少一點，避免擠不下 */
@media (min-width: 1300px) and (min-height: 760px) { body { zoom: 1.12; height: calc(100dvh / 1.12); min-width: calc(1100px / 1.12); } }
@media (min-width: 1500px) and (min-height: 860px) { body { zoom: 1.25; height: calc(100dvh / 1.25); min-width: calc(1100px / 1.25); } }
/* WEB-010 角色卡內容變多：卡片佔右欄六成、行距縮小，真的放不下時右邊那欄可以捲 */
.me-card { flex: 1.5 1 0; }
.me-side { gap: 4px; overflow: auto; min-height: 0; }
.me-body { align-items: stretch; min-height: 0; }
.me-side .me-name { font-size: 15px; }
.me-stats td, .me-stats th { padding: 1px 0; }
.me-side button { margin-top: 4px; padding: 6px 10px; }
.me-lv { grid-template-columns: auto 1fr auto; } .me-exp { grid-column: auto; }
.me-card { flex: 1.9 1 0; } .me-coins { font-size: 11px; }
/* 角色卡：每一行都不能被壓扁（名字之前在空間不夠時被壓成 0 高度）；調整外觀按鈕疊在角色圖下方，右欄多出一行空間 */
.me-side > * { flex-shrink: 0; }
.me-body { position: relative; }
.me-side [data-edit] { position: absolute; left: 14px; bottom: 14px; width: calc(46% - 12px); margin: 0; opacity: .95; }
.me-side .me-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.me-side [data-edit] { display: none; }

/* 三欄版面：左＝大廳在線玩家、中＝房間列表＋留言板、右＝我的角色資訊（整欄高） */
main { grid-template-columns: minmax(210px, 0.8fr) minmax(0, 2.6fr) minmax(250px, 1fr); }
.players { grid-column: 1; grid-row: 1 / 3; }
.rooms { grid-column: 2; grid-row: 1; }
.chat { grid-column: 2; grid-row: 2; }
.me-col { grid-column: 3; grid-row: 1 / 3; display: flex; flex-direction: column; min-height: 0; }
.me-col .me-card { flex: 1 1 auto; border-top: 0; margin-top: 0; padding-top: 0; }
.me-col .me-body { flex-direction: column; align-items: stretch; gap: 10px; }
.me-col .me-body img { width: 100%; height: auto; flex: 1 1 0; min-height: 120px; }
.me-col .me-side { flex: 0 0 auto; overflow: visible; }
.me-col .me-side .me-name { font-size: 17px; }
/* 右欄角色資訊：圖片限高、資料字放大、行距拉開 */
main { grid-template-columns: minmax(200px, 0.75fr) minmax(0, 2.5fr) minmax(260px, 1.05fr); }
.me-col .me-body { gap: 12px; padding: 10px; }
.me-col .me-body img { flex: 1 1 0; min-height: 140px; max-height: 46%; object-fit: contain; }
.me-col .me-side { gap: 9px; padding: 0 4px 4px; }
.me-col .me-side .me-name { font-size: 18px; margin: 0; }
.me-col .me-title { font-size: 13px; margin: -4px 0 0; }
.me-col .me-lv { font-size: 13px; gap: 4px 10px; } .me-col .me-lvn { font-size: 16px; } .me-col .me-bar { height: 9px; } .me-col .me-exp { font-size: 11px; }
.me-col .me-coins { font-size: 12px; color: #c5d2e2; }
.me-col .me-stats { font-size: 13px; } .me-col .me-stats th { font-size: 11px; padding-bottom: 4px; }
.me-col .me-stats td { padding: 5px 0; border-top: 1px solid #1f2c40; }

/* 成就系統（兩欄：左＝系列詳情與階梯進度、右＝名字框＋分類＋系列清單） */
#ach-panel { width: min(1060px, 94vw); max-height: 90dvh; padding: 0; background: #121c2b; color: #e5edf7; border: 1px solid #2c3b52; border-radius: 14px; }
#ach-panel form { display: flex; flex-direction: column; max-height: 90dvh; }
.ach-top { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-bottom: 1px solid #22314a; }
.ach-top h2 { margin: 0; font-size: 20px; color: #fff; }
.ach-back { background: transparent; border: 0; color: #e5edf7; font-size: 22px; cursor: pointer; padding: 0 6px; }
.ach-cols { display: grid; grid-template-columns: 0.95fr 1.25fr; min-height: 0; flex: 1; overflow: hidden; }
.ach-detail { padding: 18px 20px; border-right: 1px solid #22314a; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.ach-right { padding: 18px 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.ach-hero { text-align: center; padding: 18px; border: 1px solid #f9952888; border-radius: 12px; background: radial-gradient(circle at 50% 0, #2a2418, #141d2c 70%); }
.ach-hero-ic { font-size: 46px; } .ach-hero h3 { margin: 6px 0 4px; color: #ffb363; font-size: 18px; } .ach-hero p { margin: 0 0 12px; color: #b8c4d6; font-size: 13px; }
.ach-hero-pr { display: flex; justify-content: space-between; font-size: 12px; color: #c5d2e2; margin-bottom: 5px; } .ach-hero-pr b { color: #ffb363; }
.ach-bar { height: 7px; background: #0b1220; border-radius: 4px; overflow: hidden; } .ach-bar.big { height: 10px; } .ach-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f39227, #ffd092); }
.ach-tiers-h { display: flex; justify-content: space-between; font-size: 12px; color: #9bafc0; } .ach-tiers-h b { color: #ffb363; }
.ach-tiers { display: flex; flex-direction: column; gap: 10px; }
.ach-t { padding: 12px 14px; border: 1px solid #2a3a52; border-radius: 10px; background: #0f1a2b; }
.ach-t.ok { border-color: #f99528; background: #221a12; }
.ach-t-h { display: flex; align-items: center; gap: 8px; } .ach-t-h b { flex: 1; font-size: 14px; }
.ach-t-n { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; background: #1d2a3d; color: #ffb363; font-size: 11px; font-weight: 700; }
.ach-t p { margin: 6px 0 8px; font-size: 12px; color: #9bafc0; }
.ach-t-pr { display: flex; justify-content: space-between; font-size: 11px; color: #c5d2e2; margin-bottom: 4px; }
.ach-t-done { font-size: 12px; color: #3dd68c; background: #123326; border: 1px solid #1f6b47; border-radius: 6px; padding: 5px 10px; }
.ach-t-one { font-size: 11px; color: #7d91aa; }
.ach-badge { font-size: 11px; color: #ffb363; border: 1px solid #f9952888; background: #2a1e15; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.ach-badge.sm { font-size: 10px; padding: 2px 6px; } .ach-badge.off { color: #7d91aa; border-color: #2a3a52; background: transparent; }
.ach-me { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #2a3a52; border-radius: 10px; background: #0f1a2b; }
.ach-me-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 2px solid #f99528; font-size: 20px; }
.ach-me-tx { flex: 1; display: flex; flex-direction: column; gap: 3px; } .ach-me-tx b { font-size: 15px; } .ach-me-tx span { font-size: 11px; color: #9bafc0; }
.ach-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.ach-cats button { padding: 7px 14px; border-radius: 8px; border: 1px solid #2c3b52; background: #1a2638; color: #c5d2e2; font: inherit; font-size: 13px; cursor: pointer; }
.ach-cats button[aria-selected="true"] { background: #f07c24; border-color: #f07c24; color: #fff; font-weight: 700; }
.ach-series { display: flex; flex-direction: column; gap: 10px; }
.ach-s { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border: 1px solid #2a3a52; border-radius: 12px; background: #141f30; color: inherit; font: inherit; cursor: pointer; }
.ach-s:hover { border-color: #4c607b; } .ach-s.on { border-color: #f99528; box-shadow: 0 0 0 1px #f9952855, 0 0 18px #f9952822; }
.ach-s-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: #0b1220; border: 1px solid #2a3a52; font-size: 22px; flex-shrink: 0; }
.ach-s-tx { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; } .ach-s-tx b { font-size: 14px; } .ach-s-tx small { font-size: 12px; color: #9bafc0; }
.ach-s-b { font-size: 11px; color: #e5edf7; background: #0b1220; border: 1px solid #2c3b52; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.ach-s.done .ach-s-b { color: #3dd68c; border-color: #1f6b47; background: #123326; }
.ach-s-ar { color: #7d91aa; font-size: 14px; }
.ach-tip { margin: 0; padding: 10px 22px; border-top: 1px solid #22314a; font-size: 11px; color: #7d91aa; }
/* 大廳整體放大（zoom）時 dvh 也會被放大：對話框高度要除以放大倍率才不會超出畫面 */
@media (min-width: 1300px) and (min-height: 760px) { body { --z: 1.12; } }
@media (min-width: 1500px) and (min-height: 860px) { body { --z: 1.25; } }
dialog { max-height: calc((100dvh - 36px) / var(--z, 1)); }
#ach-panel, #ach-panel form { max-height: calc(92dvh / var(--z, 1)); }
/* 成就系統面板固定大小：切換分類、系列時不會變大變小（內容在兩欄裡各自捲動） */
#ach-panel { width: min(1060px, 94vw); height: calc(86dvh / var(--z, 1)); }
#ach-panel form { height: 100%; }

/* 球衣與裝備（三欄，固定大小）：左＝預覽＋目前穿戴＋玩家資料、中＝分類＋物品格、右＝稱號＋動作 */
#equip-panel { width: min(1280px, 96vw); height: calc(90dvh / var(--z, 1)); max-height: none; padding: 0; background: #0f1826; color: #e5edf7; border: 1px solid #2c3b52; border-radius: 14px; }
#equip-panel form { display: flex; flex-direction: column; height: 100%; }
.eqx-top { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid #22314a; }
.eqx-top h2 { margin: 0; font-size: 20px; color: #fff; flex: 1; }
.eqx-back { background: transparent; border: 0; color: #e5edf7; font-size: 22px; cursor: pointer; padding: 0 6px; }
.eqx-money { display: flex; gap: 10px; } .eqx-money span { padding: 6px 14px; border: 1px solid #2c3b52; border-radius: 10px; background: #121d2e; font-size: 13px; color: #c5d2e2; } .eqx-money b { color: #fff; }
.eqx-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.45fr 0.95fr; gap: 14px; padding: 14px; }
.eqx-cols > section { min-height: 0; border: 1px solid #22314a; border-radius: 14px; background: #121c2b; padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.eqx-stage { position: relative; flex: 1; min-height: 0; display: flex; gap: 10px; border-radius: 12px; background: radial-gradient(circle at 40% 30%, #1d2c44, #0f1826 70%); overflow: hidden; }
.eqx-img { flex: 1; min-width: 0; height: 100%; object-fit: contain; }
.eqx-tools { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 1; }
.eqx-tools button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid #2c3b52; background: #121d2ecc; color: #e5edf7; font-size: 16px; cursor: pointer; padding: 0; }
.eqx-worn { width: 46%; max-width: 170px; margin: 8px 8px 8px 0; padding: 8px; border: 1px solid #f9952899; border-radius: 12px; background: #171f2ccc; overflow: auto; }
.eqx-worn h4 { margin: 0 0 6px; font-size: 13px; color: #ffb363; }
.eqx-worn ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.eqx-worn li { display: flex; align-items: center; gap: 8px; } .eqx-worn li.off { opacity: .55; }
.eqx-worn li > span:last-child { display: flex; flex-direction: column; min-width: 0; } .eqx-worn small { font-size: 10px; color: #9bafc0; } .eqx-worn b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eqx-wi { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; border-radius: 8px; border: 1px solid #2a3a52; background: linear-gradient(135deg, color-mix(in srgb, var(--t) 45%, #0b1220), #0b1220); font-size: 15px; }
.eqx-card { border: 1px solid #22314a; border-radius: 12px; padding: 10px 12px; background: #0f1826; }
.eqx-name { display: flex; gap: 8px; } .eqx-name input { flex: 1; min-width: 0; font: inherit; font-size: 16px; font-weight: 700; color: #fff; background: #0b1220; border: 1px solid #2c3b52; border-radius: 8px; padding: 6px 10px; }
.eqx-name button { padding: 6px 12px; border-radius: 8px; border: 1px solid #f99528; background: #2a1e15; color: #ffb363; font: inherit; font-size: 12px; cursor: pointer; }
.eqx-err { margin: 4px 0 0; min-height: 16px; font-size: 11px; color: #ffb363; }
.eqx-card dl { margin: 2px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12px; } .eqx-card dt { color: #9bafc0; } .eqx-card dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.eqx-bar { flex: 1; height: 7px; background: #1d2a3d; border-radius: 4px; overflow: hidden; } .eqx-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f39227, #ffd092); }
.eqx-card dd small { font-size: 10px; color: #7d91aa; }
.eqx-look { padding: 11px; border-radius: 10px; font-size: 15px; }
.eqx-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.eqx-tabs button { padding: 8px 14px; border-radius: 9px; border: 1px solid #2c3b52; background: #1a2638; color: #c5d2e2; font: inherit; font-size: 13px; cursor: pointer; }
.eqx-tabs button[aria-selected="true"] { background: #f07c24; border-color: #f07c24; color: #fff; font-weight: 700; }
.eqx-grid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); grid-auto-rows: 150px; gap: 10px; align-content: start; }
.eqx-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1px solid #2a3a52; border-radius: 12px; background: #141f30; color: inherit; font: inherit; cursor: pointer; padding: 10px; }
.eqx-item:hover { border-color: #4c607b; } .eqx-item.on { border-color: #f99528; box-shadow: 0 0 0 1px #f9952866, 0 0 16px #f9952833; }
.eqx-item.lock { opacity: .5; cursor: not-allowed; }
.eqx-ii { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 14px; border: 1px solid #2a3a52; background: linear-gradient(135deg, color-mix(in srgb, var(--t) 55%, #0b1220), #0b1220); font-size: 30px; }
.eqx-item b { font-size: 12px; text-align: center; } .eqx-item small { font-size: 10px; color: #9bafc0; }
.eqx-check { position: absolute; right: 8px; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: #f07c24; color: #fff; font-style: normal; font-size: 12px; display: grid; place-items: center; }
.eqx-hint { margin: 0; }
.eqx-right { gap: 12px !important; overflow: auto !important; }
.eqx-box { border: 1px solid #22314a; border-radius: 12px; padding: 12px; background: #0f1826; }
.eqx-box h3 { margin: 0 0 10px; font-size: 15px; color: #ffb363; }
.eqx-badge { display: flex; align-items: center; gap: 8px; text-align: center; } .eqx-badge > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.eqx-badge button { width: 30px; height: 30px; border: 0; background: transparent; color: #f99528; font-size: 24px; cursor: pointer; }
.eqx-medal { font-size: 52px; line-height: 1.1; filter: drop-shadow(0 4px 10px #f9952855); }
.eqx-badge b { padding: 4px 16px; border: 1px solid #2c3b52; border-radius: 8px; background: #121d2e; color: #ffcf9a; font-size: 14px; } .eqx-badge small { font-size: 10px; color: #9bafc0; }
.eqx-apply { width: 100%; margin-top: 10px; padding: 8px; border-radius: 9px; border: 1px solid #f99528; background: #2a1e15; color: #ffb363; font: inherit; font-size: 13px; cursor: pointer; } .eqx-apply:disabled { opacity: .6; cursor: default; }
.eqx-wheel { position: relative; width: 190px; height: 190px; margin: 0 auto 10px; border-radius: 50%; border: 1px solid #2c3b52; background: radial-gradient(circle, #1a2638, #0f1826); }
.eqx-hub { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; border: 2px solid #f99528; display: grid; place-items: center; color: #ffb363; font-weight: 900; }
.eqx-slot { position: absolute; width: 64px; margin-left: -32px; text-align: center; display: flex; flex-direction: column; align-items: center; } .eqx-slot b { font-size: 22px; } .eqx-slot small { font-size: 9px; color: #7d91aa; } .eqx-slot span { font-size: 10px; color: #c5d2e2; }
.eqx-slot.s0 { left: 22%; top: 34%; } .eqx-slot.s1 { left: 78%; top: 34%; } .eqx-slot.s2 { left: 50%; top: 4%; } .eqx-slot.s3 { left: 50%; top: 64%; }
.eqx-emos { display: flex; flex-wrap: wrap; gap: 6px; } .eqx-emos button { padding: 5px 9px; font-size: 12px; border-radius: 8px; border: 1px solid #2c3b52; background: #1a2638; color: #e5edf7; font-family: inherit; cursor: pointer; }
.eqx-emos button[aria-pressed="true"] { border-color: #f99528; background: #3a2615; color: #ffcf9a; } .eqx-emos button:disabled { opacity: .45; cursor: not-allowed; }
/* 裝備面板微調：預覽大一點、目前穿戴縮窄、輪盤四格不重疊、分頁一行 */
.eqx-worn { width: 132px; flex-shrink: 0; }
.eqx-img { min-height: 0; }
.eqx-tabs { flex-wrap: nowrap; overflow-x: auto; } .eqx-tabs button { padding: 7px 11px; font-size: 12px; white-space: nowrap; }
.eqx-wheel { width: 210px; height: 210px; }
.eqx-slot { width: 70px; margin-left: -35px; gap: 1px; line-height: 1.15; }
.eqx-slot.s0 { left: 19%; top: 37%; } .eqx-slot.s1 { left: 81%; top: 37%; } .eqx-slot.s2 { left: 50%; top: 5%; } .eqx-slot.s3 { left: 50%; top: 69%; }
/* 裝備面板：即時預覽（拖曳旋轉） */
.eqx-stage canvas.eqx-img { display: block; width: 100%; height: 100%; flex: 1; min-width: 0; }
.eqx-drag { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 11px; color: #9bafc0; background: #0b1220aa; padding: 3px 10px; border-radius: 10px; pointer-events: none; white-space: nowrap; }

/* WEB-011 好友 */
.add-friend { margin-left: 6px; padding: 3px 8px; font-size: 10px; border-radius: 6px; border: 1px solid #2c3b52; background: #1a2638; color: #9fd5ff; cursor: pointer; opacity: 0; transition: opacity .15s; }
.player:hover .add-friend, .add-friend:focus-visible { opacity: 1; }
.fr-badge { margin-left: 6px; min-width: 16px; padding: 0 5px; border-radius: 8px; background: #e5483c; color: #fff; font-size: 10px; line-height: 16px; }
#friends-panel { width: min(900px, 94vw); height: calc(80dvh / var(--z, 1)); max-height: none; padding: 0; background: #121c2b; color: #e5edf7; border: 1px solid #2c3b52; border-radius: 14px; }
#friends-panel form { display: flex; flex-direction: column; height: 100%; }
.fr-top { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid #22314a; } .fr-top h2 { margin: 0; font-size: 20px; color: #fff; }
.fr-back { background: transparent; border: 0; color: #e5edf7; font-size: 22px; cursor: pointer; }
.fr-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 0.9fr 1.3fr; }
.fr-left { padding: 14px; border-right: 1px solid #22314a; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.fr-add { display: flex; gap: 6px; } .fr-add input { flex: 1; min-width: 0; font: inherit; color: #fff; background: #0b1220; border: 1px solid #2c3b52; border-radius: 8px; padding: 7px 10px; } .fr-add button { padding: 7px 12px; border-radius: 8px; }
.fr-msg { margin: 0; min-height: 16px; font-size: 12px; color: #ffb363; }
.fr-list h4 { margin: 10px 0 6px; font-size: 12px; color: #9bafc0; font-weight: 500; }
.fr-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid #22314a; border-radius: 10px; background: #0f1a2b; margin-bottom: 6px; cursor: pointer; }
.fr-row.on { border-color: #f99528; } .fr-row b { flex: 1; font-size: 13px; } .fr-row button { padding: 4px 9px; font-size: 11px; border-radius: 7px; }
.fr-dot { width: 9px; height: 9px; border-radius: 50%; background: #3a4a63; } .fr-dot.online { background: #3dd68c; box-shadow: 0 0 6px #3dd68c; }
.fr-unread { min-width: 18px; padding: 0 5px; border-radius: 9px; background: #e5483c; color: #fff; font-size: 11px; text-align: center; }
.fr-chat { display: flex; flex-direction: column; min-height: 0; } .fr-empty { margin: auto; color: #7d91aa; font-size: 13px; }
.fr-chat-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #22314a; } .fr-chat-h b { font-size: 15px; color: #ffcf9a; } .fr-chat-h button { padding: 4px 10px; font-size: 11px; border-radius: 7px; border: 1px solid #a8483f; background: transparent; color: #ffb4a8; cursor: pointer; }
.fr-msgs { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.fr-m { max-width: 75%; align-self: flex-start; display: flex; flex-direction: column; gap: 2px; } .fr-m.mine { align-self: flex-end; align-items: flex-end; }
.fr-m span { padding: 8px 12px; border-radius: 12px; background: #1d2a3d; font-size: 13px; line-height: 1.5; word-break: break-word; } .fr-m.mine span { background: #f07c24; color: #fff; } .fr-m small { font-size: 10px; color: #7d91aa; }
.fr-send { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #22314a; } .fr-send input { flex: 1; min-width: 0; font: inherit; color: #fff; background: #0b1220; border: 1px solid #2c3b52; border-radius: 8px; padding: 8px 12px; } .fr-send button { padding: 8px 16px; border-radius: 8px; }
.add-friend { display: none; opacity: 1; } .player:hover .add-friend, .player:focus-within .add-friend { display: inline-block; }
.player:hover .state { display: none; }
/* 2026-11-18 角色看板：可以轉的角色（跟「球衣與裝備」一樣拖曳轉動、滾輪縮放），左側疊稱號＋穿戴、右側疊炫技動作 */
.me-col .me-stage { position: relative; flex: 1 1 0; min-height: 200px; max-height: 58%; border-radius: 12px; overflow: hidden; background: #0a2a22; }
.me-col .me-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.me-col .me-stage img { width: 100%; height: 100%; object-fit: contain; }
.me-stage .me-l, .me-stage .me-r { position: absolute; top: 8px; bottom: 8px; width: 31%; display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 1; }
.me-stage .me-l { left: 8px; } .me-stage .me-r { right: 8px; align-items: flex-end; }
.me-stage small { display: block; font-size: 10px; letter-spacing: .08em; color: #E2B865; margin-bottom: 2px; }
.me-stage .me-tt b { display: inline-block; max-width: 100%; padding: 3px 8px; border-radius: 8px; background: linear-gradient(90deg, #E8C273, #D39A3E); color: #1B2638; font-size: 12px; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
.me-stage .me-eq, .me-stage .me-r { overflow: hidden; }
.me-stage .me-eq span, .me-stage .me-r span { display: flex; align-items: center; gap: 4px; max-width: 100%; margin-top: 3px; padding: 2px 7px 2px 3px; border-radius: 999px; background: rgba(4,20,16,.72); border: 1px solid rgba(229,184,105,.3); color: #EEF2F7; font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-stage .me-r span { flex-direction: row-reverse; padding: 2px 3px 2px 7px; }
.me-stage i { font-style: normal; flex: none; width: 18px; text-align: center; }
.me-stage .me-r span.off { opacity: .45; }
.me-stage .me-drag { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 10px; color: rgba(238,242,247,.55); pointer-events: none; white-space: nowrap; }
