:root {
  --bg: #FBF6EC;
  --bg2: #F4EDDF;
  --paper: #FFFFFF;
  --ink: #231F33;
  --ink2: #5E586F;
  --ink3: #9A93A8;
  --line: #E6DDCC;
  --pink: #F27AB8;
  --yellow: #FFC53D;
  --green: #33B679;
  --blue: #4D9DF7;
  --red: #F2553C;
  --purple: #8B6CF0;
  --orange: #FF8A3D;
  --gold: #E9A91B;
  --silver: #A7B0BE;
  --bronze: #C9763B;
  --r: 16px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --ease: cubic-bezier(.2, .9, .25, 1.15);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --dock-h: 0px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
.ico { display: inline-flex; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.ico svg { width: 100%; height: 100%; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  font-weight: 800;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), box-shadow .15s, background .15s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.btn.primary { background: var(--yellow); }
.btn.hot { background: var(--red); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.big { padding: 14px 24px; font-size: 17px; border-radius: 16px; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 11px; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: rgba(35, 31, 51, .06); }
.link { background: none; border: 0; font-weight: 700; color: var(--ink2); display: inline-flex; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.link:hover { color: var(--ink); background: rgba(35, 31, 51, .06); }
.icon-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 38px; min-width: 38px; padding: 0 10px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: var(--paper); box-shadow: var(--shadow-sm);
  font-weight: 800; font-size: 13px;
  transition: transform .15s var(--ease), background .15s;
}
.icon-btn:hover { transform: translate(-1px, -1px); }
.icon-btn:active { transform: translate(1px, 1px); box-shadow: none; }
.icon-btn.on { background: var(--yellow); }
.icon-btn .ico { width: 18px; height: 18px; }

.screen { min-height: 100vh; min-height: 100dvh; }

/* ---------- 首页 ---------- */
#home { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 28px 16px 40px; }
.home-stripes { position: absolute; inset: -20% -10%; display: flex; gap: 0; transform: rotate(-12deg); opacity: .16; pointer-events: none; }
.home-stripes i { flex: 1; animation: stripe 14s linear infinite; }
.home-stripes i:nth-child(1) { background: var(--pink); }
.home-stripes i:nth-child(2) { background: var(--yellow); }
.home-stripes i:nth-child(3) { background: var(--green); }
.home-stripes i:nth-child(4) { background: var(--blue); }
.home-stripes i:nth-child(5) { background: var(--red); }
.home-stripes i:nth-child(6) { background: var(--purple); }
@keyframes stripe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(24px); } }
.home-inner { position: relative; width: min(680px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; }
/* 挂在桌游大厅（/hunao/）时才显示的返回入口 */
.hall-back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 12px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); box-shadow: var(--shadow-sm);
  color: var(--ink); font-size: 14px; font-weight: 800; text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--ease), box-shadow .15s, background .15s; animation: rise .5s var(--ease) backwards;
}
.hall-back[hidden] { display: none; }
.hall-back:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); background: var(--yellow); }
.hall-back:active { transform: translate(1px, 1px); box-shadow: none; }
.hall-back:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.hall-back .ico { width: 18px; height: 18px; }
.logo { text-align: center; }
.logo-badge { display: inline-block; padding: 5px 14px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); font-size: 13px; font-weight: 800; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.logo-text { margin: 0; font-size: clamp(56px, 13vw, 104px); line-height: 1; font-weight: 900; letter-spacing: .02em; display: flex; justify-content: center; gap: .02em; }
.logo-text .lt {
  display: inline-block;
  color: var(--c, var(--yellow));
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink);
  animation: letterIn .7s var(--ease) both, letterBob 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * 70ms), calc(900ms + var(--i) * 180ms);
}
.logo-text .lt:nth-child(1) { --c: var(--red); transform: rotate(-6deg); }
.logo-text .lt:nth-child(2) { --c: var(--yellow); }
.logo-text .lt:nth-child(3) { --c: var(--green); }
.logo-text .lt:nth-child(4) { --c: var(--blue); }
.logo-text .lt:nth-child(5) { --c: var(--pink); }
@keyframes letterIn { from { opacity: 0; transform: translateY(40px) scale(.6) rotate(-12deg); } }
@keyframes letterBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.tagline { margin: 16px 0 0; font-size: 16px; font-weight: 700; color: var(--ink2); }
.parade { position: relative; width: 100%; height: 86px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.parade-track { position: absolute; left: 0; top: 4px; display: flex; gap: 10px; animation: parade 60s linear infinite; }
.parade-track .pr { width: 74px; height: 74px; flex: none; animation: prHop .5s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -97ms); }
@keyframes parade { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes prHop { from { transform: translateY(4px) rotate(-3deg); } to { transform: translateY(-4px) rotate(3deg); } }
.home-card { width: 100%; padding: 22px; display: flex; flex-direction: column; gap: 16px; animation: rise .6s .25s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 13px; color: var(--ink2); }
.field input, .code-join input {
  height: 48px; padding: 0 14px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--bg);
  font-size: 17px; font-weight: 700; outline: none; transition: box-shadow .15s, background .15s;
}
.field input:focus, .code-join input:focus { background: #fff; box-shadow: 0 0 0 4px rgba(255, 197, 61, .5); }
.quick-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.quick-row .btn.big { flex: 1 1 240px; }
.watch-entry { padding-top: 14px; border-top: 2px dashed var(--line); }
.watch-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.watch-row .watch-btn { flex: 1 1 240px; background: var(--bg2); }
.watch-row .watch-btn:hover { background: var(--paper); }
.watch-entry p { margin: 10px 0 0; font-size: 12px; font-weight: 700; color: var(--ink2); line-height: 1.5; }
#watchCount button { min-height: 44px; }
.seg { display: inline-flex; align-items: center; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--bg); overflow: hidden; box-shadow: var(--shadow-sm); }
.seg-label { padding: 0 10px; font-size: 13px; font-weight: 800; color: var(--ink2); }
.seg button { border: 0; border-left: 2px solid var(--ink); background: transparent; width: 42px; height: 100%; min-height: 46px; font-weight: 900; font-size: 16px; transition: background .15s; }
.seg button.on { background: var(--ink); color: #fff; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink3); font-size: 13px; font-weight: 700; }
.divider::before, .divider::after { content: ""; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.join-row { display: flex; gap: 12px; flex-wrap: wrap; }
.join-row > .btn { flex: 1 1 160px; }
.code-join { flex: 1 1 220px; min-width: 0; display: flex; gap: 8px; }
.code-join input { flex: 1; width: 0; min-width: 0; text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 900; }
.home-foot { display: flex; gap: 10px; }

/* 首页公开大厅：人数是房间概要，不展示任何对局私有信息。 */
.room-directory { width: 100%; min-width: 0; padding: 20px; }
.room-directory-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.room-directory-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 20px; font-weight: 900; }
.room-directory-head h2 .ico { width: 24px; height: 24px; }
.room-directory-head .btn { min-height: 44px; flex: none; }
.room-directory-hint { margin: 10px 0 0; color: var(--ink2); font-size: 12px; font-weight: 600; line-height: 1.6; }
.room-list-status { margin: 12px 0 0; font-size: 13px; color: var(--ink2); font-weight: 800; line-height: 1.6; }
.room-list { display: grid; gap: 12px; padding: 0; margin: 14px 0 0; list-style: none; }
.room-list:empty { margin-top: 0; }
.room-list-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) 116px; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 2px solid var(--ink); border-radius: 16px; background: var(--bg); box-shadow: var(--shadow-sm); }
.room-list-item.watch-room { background: var(--bg2); }
.room-list-icon { align-self: start; width: 38px; height: 38px; padding: 7px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px; }
.watch-room .room-list-icon { background: var(--paper); }
.room-list-info { min-width: 0; }
.room-list-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; font-weight: 900; }
.room-list-host { min-width: 0; font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-list-code { flex: none; padding: 2px 5px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 6px; font-size: 12px; font-weight: 900; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.room-list-state, .room-list-meta { margin: 6px 0 0; font-size: 12px; font-weight: 700; color: var(--ink2); line-height: 1.5; overflow-wrap: anywhere; }
.room-state { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; background: var(--paper); color: var(--ink); }
.room-state.lobby { border-color: var(--ink); background: var(--yellow); border-bottom: 2px solid var(--green); }
.room-state.playing { border-bottom: 2px solid var(--blue); }
.room-state.over { color: var(--ink2); }
.room-list-action { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; max-width: 124px; }
.room-list-action .btn { min-width: 78px; min-height: 44px; padding: 8px 12px; }
.room-list-action .btn:disabled { opacity: .6; background: var(--bg2); cursor: not-allowed; }
.room-list-note { color: var(--ink2); font-size: 11px; font-weight: 700; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .room-directory { padding: 18px 16px; }
  .room-directory-head h2 { font-size: 18px; }
  .room-list-item { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .room-list-icon { width: 34px; height: 34px; padding: 6px; }
  .room-list-host { font-size: 14px; }
  .room-list-action { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; max-width: none; padding-top: 8px; border-top: 1px dashed var(--line); }
  .room-list-action .btn { flex: none; min-width: 92px; }
  .room-list-note { text-align: left; }
}

/* ---------- 房间 ---------- */
#lobby { display: flex; justify-content: center; padding: 28px 16px 40px; }
.lobby-inner { position: relative; width: min(820px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.back { align-self: flex-start; }
.room-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.invite-link { display: flex; flex-direction: column; gap: 6px; width: min(460px, 100%); margin-top: 8px; }
.invite-link label { font-size: 13px; font-weight: 800; }
.invite-link input { width: 100%; min-width: 0; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); font-size: 14px; }
.invite-link span { color: var(--ink2); font-size: 12px; }
.room-label { font-weight: 800; color: var(--ink2); font-size: 14px; }
.room-code { font-size: 64px; font-weight: 900; letter-spacing: .18em; padding: 4px 18px 4px 30px; border: 3px solid var(--ink); border-radius: 20px; background: var(--yellow); box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.seats { width: min(640px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 520px) { .seats { grid-template-columns: repeat(2, 1fr); } }
.seat { position: relative; padding: 16px 12px 14px; text-align: center; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-sm); animation: pop .4s var(--ease) both; }
.seat.empty { border-style: dashed; box-shadow: none; background: transparent; color: var(--ink3); display: flex; align-items: center; justify-content: center; min-height: 142px; font-weight: 800; }
.seat .ava { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; border: 3px solid var(--ink); background: var(--c); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 900; color: #fff; }
.seat .ava .ico { width: 30px; height: 30px; }
.seat .nm { font-weight: 900; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .tag { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--ink2); display: flex; justify-content: center; gap: 6px; align-items: center; }
.seat .tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.seat .tag .dot.off { background: var(--ink3); }
.seat .kick { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ink); background: var(--paper); display: flex; align-items: center; justify-content: center; padding: 3px; }
.lobby-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.lobby-tip { margin: 0; color: var(--ink2); font-weight: 600; font-size: 14px; text-align: center; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }

/* ---------- 对局布局 ---------- */
#game {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "side" "stage" "dock";
  height: 100vh; height: 100dvh;
  position: relative;
  gap: 0;
  padding: 10px 14px 12px;
}
.topbar { grid-area: top; display: flex; align-items: center; gap: 12px; padding-bottom: 10px; min-width: 0; }
.races { display: flex; gap: 6px; flex: none; }
.race-pill { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); font-size: 12px; font-weight: 800; transition: background .3s, transform .3s var(--ease); }
.race-pill .no { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.race-pill.wild .no { background: var(--red); }
.race-pill.cur { background: var(--yellow); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.race-pill.done { opacity: .55; }
.race-pill .pts { color: var(--ink2); font-weight: 700; }
.top-title { flex: 1; min-width: 0; font-weight: 900; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.top-actions { display: flex; gap: 6px; flex: none; }
.spectator-status { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; font-size: 12px; font-weight: 800; color: var(--ink2); }
.spectator-status > .ico { color: var(--ink); flex: none; }
#spectatorLabel { white-space: nowrap; color: var(--ink); }
.spectator-viewers { white-space: nowrap; }
.spectator-code { margin-left: auto; white-space: nowrap; padding: 3px 8px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 8px; font-variant-numeric: tabular-nums; }
#game[data-mode="spectator"] .top-title { display: none; }
#game[data-mode="spectator"] .rcard:not(.pickable) { cursor: help; }
#game[data-mode="spectator"] .dock .timer { display: none; }
@media (max-width: 1200px) {
  #game[data-mode="spectator"] .topbar { flex-wrap: wrap; }
  #game[data-mode="spectator"] .top-actions { margin-left: auto; }
  .spectator-status { order: 3; flex-basis: 100%; }
}
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 550px) {
  #game[data-mode="spectator"] .topbar { flex-wrap: wrap; }
  .spectator-status { gap: 6px; font-size: 11px; }
  #game[data-mode="spectator"] .dock .prompt { flex-wrap: wrap; }
  #game[data-mode="spectator"] .dock .p-opts { flex: 0 1 auto; }
}
@media (max-width: 360px) {
  #game[data-mode="spectator"] .topbar { gap: 6px; }
  #game[data-mode="spectator"] .top-actions { gap: 4px; }
  #game[data-mode="spectator"] .races { width: 100%; }
  #game[data-mode="spectator"] .top-actions { margin-left: 0; }
  .spectator-status { gap: 5px; }
  .spectator-viewers { display: none; }
  .home-card { padding: 18px; }
  #aiCount, #watchCount { max-width: 100%; }
}

.stage { grid-area: stage; position: relative; min-height: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 10px; }
.board-wrap { width: 100%; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; container-type: size; }
.board {
  --bw: 964; --bh: 470;
  position: relative;
  width: min(100cqw, calc(100cqh * var(--bw) / var(--bh)));
  aspect-ratio: var(--bw) / var(--bh);
  --u: calc(min(100cqw, calc(100cqh * var(--bw) / var(--bh))) / var(--bw));
}
.board.tall { --bw: 460; --bh: 622; }
#trackSvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cell { transition: transform .25s var(--ease), filter .25s; transform-box: fill-box; transform-origin: center; }
.cell.pulse { animation: cellPulse .5s var(--ease); }
@keyframes cellPulse { 40% { transform: scale(1.14); filter: brightness(1.15); } }
.cell.pick { cursor: pointer; animation: cellPick 1s ease-in-out infinite; }
@keyframes cellPick { 50% { transform: scale(1.08); filter: brightness(1.12) drop-shadow(0 0 6px var(--yellow)); } }

.center { position: absolute; display: flex; gap: calc(12 * var(--u)); pointer-events: none; }
.center-main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.center-track { display: flex; flex-direction: column; align-items: center; gap: calc(8 * var(--u)); transition: opacity .3s, transform .3s var(--ease); }
.center-track b { font-weight: 900; font-size: calc(38 * var(--u)); line-height: 1.05; color: var(--c, var(--green)); -webkit-text-stroke: calc(2.5 * var(--u)) var(--ink); paint-order: stroke fill; text-shadow: calc(3 * var(--u)) calc(3 * var(--u)) 0 var(--ink); letter-spacing: .06em; }
.center-track small { font-size: calc(14 * var(--u)); font-weight: 800; color: var(--ink2); letter-spacing: .08em; }
.legend { display: flex; gap: calc(8 * var(--u)); flex-wrap: wrap; justify-content: center; }
.legend span { display: inline-flex; align-items: center; gap: calc(5 * var(--u)); padding: calc(3 * var(--u)) calc(10 * var(--u)) calc(3 * var(--u)) calc(4 * var(--u)); background: rgba(255, 255, 255, .8); border: calc(2 * var(--u)) solid var(--ink); border-radius: 99px; font-size: calc(13 * var(--u)); font-weight: 800; }
.legend svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); }
.legend i { font-style: normal; }
.you .you-auto { display: none; font-style: normal; }
/* 竖屏棋盘中央窄：图例只留图标 + 效果，一行放下，不换行（换行的第二行会被回合卡盖住） */
.board.tall .legend { flex-wrap: nowrap; gap: calc(5 * var(--u)); }
.board.tall .legend span { white-space: nowrap; padding-right: calc(8 * var(--u)); }
.board.tall .legend i { display: none; }
.center.busy .center-track { opacity: .12; transform: scale(.94); }
.dice-zone { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: calc(18 * var(--u)); }
.commentary { position: absolute; left: 0; right: 0; bottom: calc(2 * var(--u)); font-size: calc(17 * var(--u)); font-weight: 800; color: var(--ink); min-height: 1.4em; }
.commentary span { display: inline-block; padding: calc(4 * var(--u)) calc(14 * var(--u)); background: var(--paper); border: 2px solid var(--ink); border-radius: 99px; box-shadow: var(--shadow-sm); animation: comIn .35s var(--ease); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes comIn { from { opacity: 0; transform: translateY(8px) scale(.9); } }

/* 骰子 */
/* 投影只给骰面：挂在 .die 上会连下方的名字一起投出重影 */
.die { width: calc(84 * var(--u)); height: calc(84 * var(--u)); position: relative; }
.die svg { width: 100%; height: 100%; filter: drop-shadow(calc(3 * var(--u)) calc(4 * var(--u)) 0 rgba(35, 31, 51, .9)); }
.die.rolling { animation: dieRoll .5s linear infinite; }
.die.land { animation: dieLand .45s var(--ease); }
@keyframes dieRoll { 0% { transform: rotate(0) translateY(0); } 25% { transform: rotate(90deg) translateY(-12%); } 50% { transform: rotate(180deg) translateY(0); } 75% { transform: rotate(270deg) translateY(-8%); } 100% { transform: rotate(360deg); } }
@keyframes dieLand { 0% { transform: scale(1.35) rotate(-14deg); } 60% { transform: scale(.92) rotate(4deg); } 100% { transform: scale(1); } }
.die-cap { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 6px); white-space: nowrap; font-size: calc(14 * var(--u)); font-weight: 800; color: var(--ink2); }
.calc { display: flex; align-items: center; gap: calc(6 * var(--u)); flex-wrap: wrap; justify-content: center; font-weight: 900; font-size: calc(22 * var(--u)); animation: comIn .3s var(--ease); }
.calc .m { padding: calc(2 * var(--u)) calc(10 * var(--u)); border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); font-size: .7em; }
.calc .m.neg { background: #FFE1DC; }
.calc .m.pos { background: #DDF5E8; }
.calc .eq { font-size: 1.4em; padding: 0 calc(10 * var(--u)); border-radius: 12px; background: var(--yellow); border: 2.5px solid var(--ink); box-shadow: var(--shadow-sm); }

/* 棋子 */
.tokens, .floaters { position: absolute; inset: 0; pointer-events: none; }
.token {
  position: absolute; left: 0; top: 0;
  width: calc(46 * var(--u)); height: calc(46 * var(--u));
  margin: calc(-23 * var(--u)) 0 0 calc(-23 * var(--u));
  transition: left .17s cubic-bezier(.3, .7, .4, 1), top .17s cubic-bezier(.3, .7, .4, 1), opacity .3s, transform .3s var(--ease);
  z-index: 2;
  pointer-events: auto;
}
.token.slow { transition-duration: .45s; }
.token .hop { width: 100%; height: 100%; position: relative; }
.token .hop.go { animation: hop .17s ease-out; }
@keyframes hop { 50% { transform: translateY(-38%) scale(1.06, .96); } }
.token .body { position: absolute; inset: 0; border-radius: 50%; background: var(--paper); border: calc(3 * var(--u)) solid var(--c); box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink), calc(2 * var(--u)) calc(3 * var(--u)) 0 calc(2 * var(--u)) var(--ink); overflow: hidden; transition: transform .35s var(--ease); }
.token .body svg { width: 118%; height: 118%; margin: -9% 0 0 -9%; }
.token.tripped .body { transform: rotate(90deg) scale(.92); }
.token.tripped::after { content: ""; position: absolute; right: -10%; top: -14%; width: 42%; height: 42%; background: var(--paper) center/70% no-repeat; border: 2px solid var(--ink); border-radius: 50%; background-image: var(--swirl); animation: spin 2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.token.cur .body { box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink), 0 0 0 calc(7 * var(--u)) rgba(255, 197, 61, .85), calc(2 * var(--u)) calc(3 * var(--u)) 0 calc(6 * var(--u)) var(--ink); }
.token.cur { z-index: 5; }
.token .seat-dot { position: absolute; left: 50%; bottom: -16%; transform: translateX(-50%); padding: 0 calc(6 * var(--u)); height: calc(16 * var(--u)); line-height: calc(13 * var(--u)); border-radius: 99px; background: var(--c); border: calc(2 * var(--u)) solid var(--ink); color: #fff; font-size: calc(10 * var(--u)); font-weight: 900; white-space: nowrap; max-width: calc(56 * var(--u)); overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }
/* 名字签不超过一格宽，压到别人时由 fitTags 收起 */
.token.notag .seat-dot { opacity: 0; }
.token.out { opacity: 0; transform: scale(.2) rotate(200deg); }
.token.done { opacity: .95; }
.token .place { position: absolute; right: -12%; top: -12%; width: 46%; height: 46%; border-radius: 50%; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: calc(15 * var(--u)); background: var(--gold); color: #fff; animation: pop .4s var(--ease); }
.token .place.p2 { background: var(--silver); }
.token.selectable { cursor: pointer; z-index: 8; }
.token.selectable .body { animation: selPulse .9s ease-in-out infinite; }
@keyframes selPulse { 50% { box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink), 0 0 0 calc(9 * var(--u)) rgba(77, 157, 247, .7); } }
.token.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6%); } 40%, 80% { transform: translateX(6%); } }
.token.warp-out { opacity: 0; transform: scale(.3) rotate(-90deg); }

.floater {
  position: absolute; transform: translate(-50%, -100%);
  padding: calc(5 * var(--u)) calc(13 * var(--u));
  border: calc(2 * var(--u)) solid var(--ink); border-radius: 99px;
  background: var(--fc, var(--yellow)); color: var(--ink);
  font-weight: 900; font-size: calc(16 * var(--u)); white-space: nowrap;
  box-shadow: var(--shadow-sm);
  animation: floatUp 1.3s var(--ease) forwards;
  z-index: 20;
}
.floater.bad { --fc: #FFD7D0; }
.floater.good { --fc: #D7F4E4; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -110%) scale(1.08); } 70% { opacity: 1; transform: translate(-50%, -150%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(.95); } }
.coin { position: fixed; width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--ink); z-index: 60; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 12px; color: #fff; pointer-events: none; transition: left .7s cubic-bezier(.5, 0, .3, 1), top .7s cubic-bezier(.3, -.6, .6, 1), transform .7s; }

/* ---------- 选秀 ---------- */
.draft { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 18px; padding: 10px; overflow: auto; }
.draft > :first-child { margin-top: auto; }
.draft > :last-child { margin-bottom: auto; }
.draft .my-team { position: sticky; bottom: 0; z-index: 3; flex: none; }
.draft-head { text-align: center; }
.draft-head h2 { margin: 0; font-size: 26px; font-weight: 900; }
.draft-head p { margin: 6px 0 0; color: var(--ink2); font-weight: 600; }
.draft-cards { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 1100px; }

/* 运动员卡牌 */
.rcard {
  --w: 168px;
  position: relative; width: var(--w); flex: none;
  border: 2.5px solid var(--ink); border-radius: 16px; background: var(--paper);
  box-shadow: var(--shadow-sm); overflow: hidden; text-align: left;
  transition: transform .2s var(--ease), box-shadow .2s, opacity .3s;
  padding: 0;
}
.rcard .art { position: relative; height: calc(var(--w) * .66); background: var(--rc); border-bottom: 2.5px solid var(--ink); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.rcard .art::before { content: ""; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 110%, rgba(255, 255, 255, .22) 0 10deg, transparent 10deg 20deg); }
.rcard .art svg { position: relative; width: 82%; height: 96%; }
.rcard .nm { position: absolute; left: 8px; top: 7px; font-weight: 900; font-size: 15px; background: var(--paper); border: 2px solid var(--ink); border-radius: 99px; padding: 1px 9px; }
.rcard .txt { padding: 9px 10px 11px; min-height: 92px; }
.rcard .sk { display: inline-block; font-size: 11px; font-weight: 900; padding: 1px 8px; border-radius: 99px; background: var(--ink); color: #fff; margin-bottom: 5px; }
.rcard .tx { font-size: 12.5px; line-height: 1.45; font-weight: 600; color: var(--ink); }
.rcard .nt { margin-top: 4px; font-size: 11px; color: var(--ink2); line-height: 1.4; }
.rcard.pickable { cursor: pointer; }
.rcard.pickable:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 5px 7px 0 var(--ink); }
.rcard.pickable:active { transform: translateY(-2px); }
.rcard.dim { opacity: .45; filter: grayscale(.4); }
.rcard.deal { animation: deal .55s var(--ease) both; animation-delay: calc(var(--k) * 60ms); }
@keyframes deal { from { opacity: 0; transform: translateY(-40px) rotate(-8deg) scale(.8); } }
.rcard.gone { animation: cardGone .45s var(--ease) forwards; }
@keyframes cardGone { to { opacity: 0; transform: translateY(-30px) scale(.7) rotate(6deg); } }
.rcard .owner { position: absolute; right: 8px; top: 8px; padding: 1px 8px; border-radius: 99px; background: var(--c); border: 2px solid var(--ink); color: #fff; font-size: 11px; font-weight: 900; }
.rcard.mini { --w: 124px; }
.rcard.mini .txt { min-height: 0; padding: 7px 8px 9px; }
.rcard.mini .tx { font-size: 11px; }
.rcard.mini .nm { font-size: 13px; }

/* ---------- 侧栏 ---------- */
.side { grid-area: side; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.players { display: flex; flex-direction: row; justify-content: center; gap: 10px; padding: 9px 4px 10px; }
.prow {
  position: relative; display: grid; flex: 0 1 210px; min-width: 0; cursor: pointer; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 6px 12px 6px 8px; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), background .25s;
}
.prow.cur { background: #FFF6DA; transform: translateY(-2px); box-shadow: 0 4px 0 var(--ink); }
.prow.me { border-width: 2.5px; }
.prow .pav { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--c); box-shadow: 0 0 0 2px var(--ink); background: var(--paper); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.prow .pav svg { width: 118%; height: 118%; }
.prow .pav .init { font-weight: 900; font-size: 18px; color: var(--c); }
.prow .pn { min-width: 0; }
.prow .pn b { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pn b .you { font-size: 10px; padding: 0 6px; border-radius: 99px; background: var(--ink); color: #fff; flex: none; }
.prow .pn b .auto { font-size: 10px; padding: 0 6px; border-radius: 99px; background: var(--line); color: var(--ink2); flex: none; }
.prow .hand { display: flex; gap: 3px; margin-top: 4px; }
.prow .hand i { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--ink); background: var(--rc, var(--bg2)); overflow: hidden; display: block; flex: none; }
.prow .hand i svg { width: 100%; height: 100%; }
.prow .hand i.used { opacity: .3; filter: grayscale(1); }
.prow .hand i.now { box-shadow: 0 0 0 2px var(--yellow); }
.prow .sc { text-align: right; }
.prow .sc b { display: block; font-size: 24px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.prow .sc span { font-size: 11px; color: var(--ink2); font-weight: 700; }
.prow .sc b.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.4); color: var(--green); } }
.prow .think { position: absolute; right: -6px; top: -8px; padding: 1px 8px; border-radius: 99px; background: var(--blue); color: #fff; border: 2px solid var(--ink); font-size: 11px; font-weight: 900; animation: pop .3s var(--ease); }
.prow .think.ok { background: var(--green); }
.bubble { position: absolute; left: 50px; top: -16px; z-index: 30; padding: 4px 12px; border-radius: 14px 14px 14px 4px; background: var(--paper); border: 2px solid var(--ink); font-weight: 900; font-size: 14px; box-shadow: var(--shadow-sm); animation: bubble 2.2s var(--ease) forwards; pointer-events: none; white-space: nowrap; }
@keyframes bubble { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 12% { opacity: 1; transform: translateY(0) scale(1.05); } 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }

/* ---------- 操作坞 ---------- */
.dock { grid-area: dock; min-height: 84px; display: flex; align-items: center; justify-content: center; padding-top: 10px; }
.prompt { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); animation: rise .35s var(--ease); position: relative; overflow: hidden; }
.prompt.mine { background: #FFF8E3; }
.prompt .p-ava { width: 50px; height: 50px; border-radius: 50%; flex: none; border: 3px solid var(--c); box-shadow: 0 0 0 2px var(--ink); overflow: hidden; background: var(--paper); }
.prompt .p-ava svg { width: 118%; height: 118%; margin: -9%; }
.prompt .p-txt { flex: 1; min-width: 0; }
.prompt .p-txt b { display: block; font-size: 16px; font-weight: 900; }
.prompt .p-txt span { display: block; font-size: 13px; color: var(--ink2); font-weight: 600; margin-top: 2px; }
.prompt .p-opts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.prompt.wait { background: var(--bg2); box-shadow: var(--shadow-sm); }
.prompt.wait .p-txt b::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; vertical-align: bottom; overflow: hidden; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.timer { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--red); transform-origin: left; }
.roll-btn { font-size: 18px; padding: 14px 28px; background: var(--yellow); animation: breathe 1.6s ease-in-out infinite; }
.roll-btn .ico { width: 26px; height: 26px; }
@keyframes breathe { 50% { box-shadow: 3px 4px 0 var(--ink), 0 0 0 4px rgba(255, 197, 61, .4); } }
.num-opts { display: flex; gap: 6px; }
.num-opts .btn { width: 46px; padding: 8px 0; font-size: 18px; }

/* 表情 */
.emotes { display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 1001px) { .emotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.emotes button { min-width: 0; white-space: nowrap; padding: 5px 8px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); font-weight: 900; font-size: 12px; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), background .15s; }
.emotes button:hover { transform: translateY(-2px); background: var(--yellow); }
.emotes button:active { transform: translateY(1px); box-shadow: none; }
.emotes .toggle { display: none; }

/* ---------- 浮层 ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(35, 31, 51, .66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.overlay.out { animation: fadeOut .3s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.ov-box { width: min(920px, 100%); max-height: 100%; overflow: auto; padding: 26px 22px; text-align: center; animation: rise .45s var(--ease); }
.ov-box h2 { margin: 0; font-size: clamp(26px, 5vw, 38px); font-weight: 900; }
.ov-box .sub { margin: 8px 0 0; color: var(--ink2); font-weight: 700; }
.ov-cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.ov-actions { margin-top: 22px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.banner { position: fixed; left: 0; right: 0; top: 38%; z-index: 45; pointer-events: none; display: flex; justify-content: center; }
.banner > div { padding: 18px 44px; background: var(--yellow); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); border-radius: 22px; text-align: center; animation: bannerIn 1.6s var(--ease) forwards; }
.banner.wild > div { background: var(--red); color: #fff; }
.banner b { display: block; font-size: clamp(28px, 6vw, 48px); font-weight: 900; line-height: 1.15; }
.banner span { display: block; margin-top: 4px; font-weight: 800; font-size: 16px; }
@keyframes bannerIn { 0% { opacity: 0; transform: translateX(-60vw) skewX(-12deg); } 22% { opacity: 1; transform: translateX(0) skewX(0); } 78% { opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(60vw) skewX(12deg); } }
.reveal-grid { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 18px; perspective: 900px; }
.flip { width: 150px; height: 214px; position: relative; transform-style: preserve-3d; animation: flipIn .8s var(--ease) both; animation-delay: calc(var(--k) * 120ms + 300ms); }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .back { transform: rotateY(180deg); border: 2.5px solid var(--ink); border-radius: 16px; background: repeating-conic-gradient(var(--pink) 0 15deg, var(--yellow) 15deg 30deg, var(--green) 30deg 45deg, var(--blue) 45deg 60deg); box-shadow: var(--shadow-sm); }
@keyframes flipIn { from { transform: rotateY(180deg); } }
.flip .rcard { --w: 150px; }
.flip .rcard { height: 100%; display: flex; flex-direction: column; }
.flip .rcard .art { flex: none; }
.flip .rcard .txt { flex: 1 1 auto; min-height: 0; }
.flip .who { position: absolute; left: 0; right: 0; bottom: -26px; font-weight: 900; font-size: 13px; }
.pick-status { height: 6px; margin: 16px auto 0; width: min(320px, 80%); border-radius: 99px; background: rgba(35, 31, 51, .14); overflow: hidden; }
.pick-status[hidden] { display: none; }
.pick-status em { display: block; height: 100%; border-radius: inherit; background: var(--yellow); box-shadow: inset 0 0 0 1px rgba(35, 31, 51, .35); }
.pick-status.urgent em { background: var(--red); }

/* 颁奖 */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-top: 24px; }
.pod { width: 150px; display: flex; flex-direction: column; align-items: center; animation: rise .6s var(--ease) both; }
.pod .who { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--c); box-shadow: 0 0 0 2.5px var(--ink); background: var(--paper); overflow: hidden; animation: podBounce 1s ease-in-out infinite alternate; }
.pod .who svg { width: 118%; height: 118%; margin: -9%; }
.pod .nm { margin-top: 8px; font-weight: 900; }
.pod .rn { font-size: 12px; color: var(--ink2); font-weight: 700; }
.pod .blk { margin-top: 8px; width: 100%; border: 2.5px solid var(--ink); border-radius: 12px 12px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; box-shadow: var(--shadow-sm); }
.pod.p1 .blk { height: 120px; background: var(--gold); font-size: 42px; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.pod.p2 .blk { height: 84px; background: var(--silver); font-size: 34px; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.pod.p3 .blk { height: 60px; background: var(--bg2); font-size: 20px; }
.pod .blk small { font-size: 13px; -webkit-text-stroke: 0; color: var(--ink); }
@keyframes podBounce { from { transform: translateY(0); } to { transform: translateY(-6px); } }
.standings { margin: 22px auto 0; width: min(560px, 100%); display: flex; flex-direction: column; gap: 6px; }
.st-row { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); text-align: left; font-weight: 800; animation: rise .4s var(--ease) both; }
.st-row .rk { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.st-row.top { background: #FFF3CF; }
.st-row .gain { color: var(--green); font-size: 13px; }
.st-row .tot { font-size: 20px; font-variant-numeric: tabular-nums; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(35, 31, 51, .6); animation: fadeIn .2s ease; }
.modal-box { width: min(980px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; animation: rise .35s var(--ease); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 2.5px solid var(--ink); }
.modal-head h3 { margin: 0; flex: 1; font-size: 20px; font-weight: 900; }
.modal-body { overflow: auto; padding: 18px; }
.rules h4 { margin: 18px 0 6px; font-size: 16px; font-weight: 900; }
.rules h4:first-child { margin-top: 0; }
.rules p, .rules li { font-size: 14px; line-height: 1.7; color: var(--ink); }
.rules ul { padding-left: 20px; margin: 4px 0; }
.rules .kw { font-weight: 900; background: var(--yellow); padding: 0 4px; border-radius: 4px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; justify-items: center; }

/* ---------- 提示 ---------- */
.toasts { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 9px 18px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper); font-weight: 800; box-shadow: var(--shadow-sm); animation: toast 2.6s var(--ease) forwards; }
.toast.err { background: #FFE1DC; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-14px); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  #game {
    grid-template-columns: 100%;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "top" "side" "stage" "dock";
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
    gap: 0;
  }
  .topbar { flex-wrap: wrap; gap: 8px; padding-bottom: 8px; }
  .top-title { order: 3; flex-basis: 100%; font-size: 15px; text-align: left; }
  .races { order: 1; }
  .race-pill .pts { display: none; }
  .race-pill { padding: 4px 7px; }
  .top-actions { order: 2; margin-left: auto; }
  .icon-btn b { display: none; }
  .icon-btn { height: 34px; min-width: 34px; padding: 0 7px; }
  .side { flex-direction: column; gap: 6px; }
  .players { flex-direction: row; overflow-x: auto; gap: 8px; padding: 2px 4px 8px 2px; scrollbar-width: none; }
  .players::-webkit-scrollbar { display: none; }
  .prow { flex: none; grid-template-columns: 34px auto auto; gap: 7px; padding: 6px 9px; }
  .prow .pav { width: 34px; height: 34px; border-width: 2px; }
  .prow .hand { display: none; }
  .prow .sc b { font-size: 18px; }
  .prow .sc span { display: none; }
  .prow.cur { transform: translateY(-2px); }
  .stage { min-height: 200px; }
  .dock { min-height: 0; padding-top: 8px; }
  .prompt { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .prompt .p-ava { width: 40px; height: 40px; }
  .prompt .p-txt b { font-size: 15px; }
  .prompt .p-opts { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; max-height: 30vh; overflow-y: auto; }
  .prompt .p-opts .btn { padding: 9px 10px; font-size: 13px; white-space: normal; line-height: 1.25; }
  .prompt .p-opts .btn.roll-btn { font-size: 17px; padding: 12px; }
  .prompt .p-opts .num-opts { grid-column: 1 / -1; justify-content: space-between; }
  .emotes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 2px 4px; }
  .emotes::-webkit-scrollbar { display: none; }
  .emotes button { flex: none; padding: 4px 9px; }
  .rcard { --w: 142px; }
  .rcard .txt { min-height: 0; }
  .draft-cards { gap: 10px; }
  .draft-head h2 { font-size: 20px; }
  .room-code { font-size: 46px; }
  .flip { width: 128px; height: 190px; }
  .flip .rcard { --w: 128px; }
  .pod { width: 104px; }
  .pod .who { width: 70px; height: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.board.tall .center { flex-direction: column; }
.board.tall .center-track b { font-size: calc(32 * var(--u)); }
.board.tall .commentary { font-size: calc(15 * var(--u)); bottom: calc(8 * var(--u)); }
.board.tall .commentary span { white-space: normal; border-radius: 14px; }
.board.tall .die { width: calc(96 * var(--u)); height: calc(96 * var(--u)); }

/* ---------- 掷骰先后 / 决斗 ---------- */
.roll-off { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.roll-off .ro { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 900; font-size: 14px; }
.roll-off .die { width: 60px; height: 60px; }
.center .roll-off .die { width: calc(56 * var(--u)); height: calc(56 * var(--u)); }
.center .roll-off .ro { font-size: calc(13 * var(--u)); }
.duel-dice { display: flex; align-items: center; gap: calc(22 * var(--u)); }
.duel-dice .vs { font-size: calc(30 * var(--u)); font-weight: 900; color: var(--red); -webkit-text-stroke: calc(2 * var(--u)) var(--ink); paint-order: stroke fill; }

/* ---------- 名次条 ---------- */

/* ---------- 当前行动卡 ---------- */
.turn-card {
  flex: none; width: calc(262 * var(--u)); align-self: center; pointer-events: auto;
  background: var(--paper); border: calc(2.5 * var(--u)) solid var(--ink); border-radius: calc(16 * var(--u));
  box-shadow: calc(3 * var(--u)) calc(3 * var(--u)) 0 var(--ink); overflow: hidden; text-align: left;
}
.turn-card.in { animation: tcIn .25s ease-out; }
@keyframes tcIn { from { opacity: 0; } }
.tc-head { display: flex; align-items: center; gap: calc(9 * var(--u)); padding: calc(8 * var(--u)) calc(10 * var(--u)); background: var(--rc); border-bottom: calc(2 * var(--u)) solid var(--ink); }
.tc-ava { width: calc(52 * var(--u)); height: calc(52 * var(--u)); flex: none; border-radius: 50%; background: var(--paper); border: calc(3 * var(--u)) solid var(--c); box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink); overflow: hidden; }
.tc-ava svg { width: 118%; height: 118%; margin: -9%; }
.tc-who { min-width: 0; }
.tc-player { display: inline-block; padding: 0 calc(8 * var(--u)); border-radius: 99px; background: var(--c); color: #fff; border: calc(1.5 * var(--u)) solid var(--ink); font-size: calc(11 * var(--u)); font-weight: 900; }
.tc-who b { display: block; font-size: calc(20 * var(--u)); font-weight: 900; line-height: 1.2; margin-top: calc(2 * var(--u)); }
.tc-skill { padding: calc(8 * var(--u)) calc(11 * var(--u)) calc(4 * var(--u)); }
.tc-skill .sk { display: inline-block; font-size: calc(11.5 * var(--u)); font-weight: 900; padding: calc(1 * var(--u)) calc(8 * var(--u)); border-radius: 99px; background: var(--ink); color: #fff; }
.tc-skill em { font-style: normal; font-size: calc(11 * var(--u)); color: var(--ink2); font-weight: 800; margin-left: calc(6 * var(--u)); }
.tc-skill p { margin: calc(5 * var(--u)) 0 0; font-size: calc(13.5 * var(--u)); line-height: 1.45; font-weight: 700; }
.tc-st { margin: 0 calc(11 * var(--u)) calc(9 * var(--u)); padding-top: calc(6 * var(--u)); border-top: calc(1.5 * var(--u)) dashed var(--line); font-size: calc(12.5 * var(--u)); font-weight: 800; color: var(--ink2); }
.tc-st b { color: var(--ink); font-size: 1.15em; }
.tc-st.bad { color: var(--red); }
.board.tall .turn-card { width: 100%; align-self: stretch; }
.board.tall .tc-head { padding: calc(6 * var(--u)) calc(10 * var(--u)); }
.board.tall .tc-skill p { font-size: calc(14 * var(--u)); }

/* ---------- 玩家栏补充 ---------- */
.prow .pline { margin-top: 2px; font-size: 12px; font-weight: 800; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pline span { color: var(--ink); }
.prow .pav, .prow .hand i { cursor: help; }

/* ---------- 赛况分色 ---------- */

/* ---------- 选秀补充 ---------- */
.draft-order { flex: none; display: flex; align-items: center; gap: 6px; max-width: 100%; overflow-x: auto; padding: 4px 6px 8px; scrollbar-width: none; }
.draft-order::-webkit-scrollbar { display: none; }
.do-label { flex: none; font-size: 12px; font-weight: 900; color: var(--ink2); margin-right: 4px; }
.do { flex: none; padding: 3px 10px; border-radius: 99px; border: 2px solid var(--c); background: var(--paper); font-size: 12.5px; font-weight: 800; color: var(--ink2); transition: all .3s var(--ease); }
.do.past { opacity: .35; border-style: dashed; }
.do.now { background: var(--c); color: #fff; border-color: var(--ink); box-shadow: var(--shadow-sm); transform: scale(1.1); }
.do-arrow { flex: none; color: var(--ink3); font-weight: 900; }
.my-team { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm); }
.my-team:empty { display: none; }
.mt-label { font-weight: 900; font-size: 13px; margin-right: 4px; }
.mt-slot { width: 64px; height: 64px; border-radius: 12px; border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-size: 11px; font-weight: 800; color: var(--ink3); position: relative; overflow: hidden; }
.mt-slot span { position: relative; z-index: 1; padding-bottom: 3px; }
.mt-slot.filled { border: 2px solid var(--ink); background: var(--rc); color: var(--ink); animation: pop .35s var(--ease); cursor: help; }
.mt-slot.filled svg { position: absolute; inset: -2px 4px 12px; width: calc(100% - 8px); height: calc(100% - 12px); }
.mt-slot.filled span { background: var(--paper); border-radius: 99px; padding: 0 6px; margin-bottom: 3px; border: 1.5px solid var(--ink); }

/* ---------- 悬停说明卡 ---------- */
.tip { position: fixed; z-index: 95; width: 290px; pointer-events: none; animation: tipIn .18s ease; }
@keyframes tipIn { from { opacity: 0; transform: translateY(4px); } }
.tip-card { display: grid; grid-template-columns: 84px 1fr; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.tip-art { background: var(--rc); border-right: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.tip-art svg { width: 92%; }
.tip-body { padding: 9px 11px 10px; }
.tip-name { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.tip-name b { font-size: 16px; font-weight: 900; }
.tip-name span { font-size: 11px; font-weight: 900; color: #fff; background: var(--c); border-radius: 99px; padding: 0 7px; border: 1.5px solid var(--ink); }
.tip-body .sk { display: inline-block; font-size: 11px; font-weight: 900; padding: 1px 8px; border-radius: 99px; background: var(--ink); color: #fff; }
.tip-body p { margin: 5px 0 0; font-size: 13px; line-height: 1.5; font-weight: 700; }
.tip-body small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink2); line-height: 1.4; }
.tip-pw { margin-top: 6px; padding: 5px 8px; border-radius: 9px; background: #EFE9FF; font-size: 12px; font-weight: 700; line-height: 1.45; }
.tip-st { margin-top: 6px; padding-top: 5px; border-top: 1.5px dashed var(--line); font-size: 12px; font-weight: 900; color: var(--ink2); }

/* ---------- 轮到你 ---------- */
.prompt.mine { border-color: var(--ink); animation: rise .35s var(--ease), mineGlow 1.8s ease-in-out .35s infinite; }
.prompt.mine::before { content: "轮到你"; position: absolute; left: 14px; top: -1px; padding: 0 8px; border-radius: 0 0 8px 8px; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; }
.prompt.mine .p-txt { padding-top: 6px; }
@keyframes mineGlow { 50% { box-shadow: 4px 4px 0 var(--ink), 0 0 0 5px rgba(255, 197, 61, .55); } }
.token { cursor: help; }
.token.selectable { cursor: pointer; }
@media (max-width: 1000px) {
  .draft { gap: 10px; padding: 6px 2px 0; }
  .draft-head p { font-size: 12px; }
  .tip { width: min(300px, calc(100vw - 16px)); }
  .my-team { gap: 6px; padding: 6px 8px; }
  .mt-slot { width: 52px; height: 52px; }
  .mt-label { font-size: 12px; }
  .prow .pline { display: none; }
}

.board.tall .token { width: calc(50 * var(--u)); height: calc(50 * var(--u)); margin: calc(-25 * var(--u)) 0 0 calc(-25 * var(--u)); }

/* 安全区保护所有入口；短横屏优先保留赛道和操作区。 */
#home, #lobby {
  padding: calc(28px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}
#game {
  padding: calc(10px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
}
.overlay, .modal {
  padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}
.connection-status {
  position: fixed; z-index: 110; left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right)); top: calc(12px + env(safe-area-inset-top));
  margin: 0 auto; width: fit-content; max-width: calc(100% - 24px); padding: 10px 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm); font-weight: 800; font-size: 13px; pointer-events: none;
}
.timer { transition: none !important; transform: none !important; }
.board.picking-cell .token { pointer-events: none; }
.toasts { top: calc(14px + env(safe-area-inset-top)); max-width: calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right) - 24px); }
@media (max-width: 1000px) {
  #game { padding: calc(8px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left)); }
  .icon-btn { height: 44px; min-width: 44px; justify-content: center; }
  #speedLabel { display: inline; }
  .btn, .link { min-height: 44px; }
  .seg button { min-width: 44px; }
  .seat .kick { width: 44px; height: 44px; padding: 10px; top: 2px; right: 2px; }
  .seat .ava { margin-top: 12px; }
  .top-actions { gap: 5px; }
  .stage { min-height: 0; }
  .prompt .p-opts .btn { min-height: 44px; }
  .gallery { gap: 12px; }
  .invite-link input { font-size: 16px; }
}
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 550px) {
  #game { grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top" "stage" "dock"; }
  #game .side { display: none; }
  .topbar { flex-wrap: nowrap; gap: 6px; padding-bottom: 4px; }
  .top-title { display: none; }
  .races { gap: 4px; }
  .race-pill { padding: 3px 6px; }
  .top-actions { margin-left: auto; }
  .dock { padding-top: 4px; }
  .prompt { flex-wrap: nowrap; gap: 8px; padding: 6px 10px; }
  .prompt .p-ava { display: none; }
  .prompt .p-txt { min-width: 0; }
  .prompt .p-txt b { font-size: 13px; }
  .prompt .p-txt span { font-size: 11px; }
  .prompt .p-opts { width: auto; display: flex; flex-wrap: wrap; flex: 1; justify-content: flex-end; max-height: 26dvh; }
  .prompt .p-opts .btn { padding: 6px 10px; }
  .prompt .p-opts:has(.num-opts) { flex-basis: 100%; min-width: 0; }
  .prompt:has(.num-opts) { flex-wrap: wrap; }
  .prompt .p-opts .num-opts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; width: 100%; min-width: 0; }
  .prompt .p-opts .num-opts .btn { min-width: 0; padding: 4px; }
  .board .tc-skill, .board .tc-st, .board .tc-gap { display: none; }
  .board .tc-who b { font-size: max(12px, calc(20 * var(--u))); }
  .board .tc-player { font-size: max(10px, calc(11 * var(--u))); }
  .draft { gap: 5px; }
  .draft-head { display: none; }
  .my-team { padding: 3px 8px; }
  .mt-slot { width: 36px; height: 36px; }
}
@media (max-width: 360px) {
  .top-actions { gap: 4px; }
  .my-team { max-width: 100%; gap: 4px; }
  .mt-slot { width: 44px; height: 44px; }
  .mt-label { font-size: 11px; margin-right: 0; }
}
button:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ================= 一屏布局 =================
   电脑和手机都不允许页面滚动：每个界面固定为一屏高（100dvh），装饰元素按可用高度逐级收起，
   放不下的集合（公开房间、选秀卡牌、图鉴、玩法说明）由 paginate() 分页，左右翻页。 */
html, body { height: 100%; height: 100dvh; overscroll-behavior: none; }
body { overflow: hidden; }
.screen { height: 100vh; height: 100dvh; min-height: 0; }

/* 分页控件 */
.pager { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.pg-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 8px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), background .15s, opacity .15s; }
.pg-btn svg { width: 100%; height: 100%; }
.pg-btn:hover:not(:disabled) { transform: translate(-1px, -1px); background: var(--yellow); }
.pg-btn:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: none; }
.pg-btn:disabled { opacity: .3; cursor: default; }
.pg-no { min-width: 44px; text-align: center; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink2); }
.pg-in-next > :not([hidden]) { animation: pgNext .38s var(--ease) both; }
.pg-in-prev > :not([hidden]) { animation: pgPrev .38s var(--ease) both; }
@keyframes pgNext { from { opacity: 0; transform: translateX(28px); } }
@keyframes pgPrev { from { opacity: 0; transform: translateX(-28px); } }

/* ---------- 首页 ---------- */
#home { align-items: stretch; padding-top: calc(clamp(10px, 2.6dvh, 28px) + env(safe-area-inset-top)); padding-bottom: calc(clamp(10px, 2.6dvh, 28px) + env(safe-area-inset-bottom)); }
.home-inner { height: 100%; min-height: 0; justify-content: center; gap: clamp(8px, 1.7dvh, 18px); margin: 0 auto; }
.home-inner > * { flex-shrink: 0; }
.logo-badge { margin-bottom: clamp(6px, 1.3dvh, 14px); }
.logo-text { font-size: clamp(40px, min(13vw, 10dvh), 104px); }
.tagline { margin-top: clamp(6px, 1.4dvh, 16px); text-wrap: balance; }
.parade { height: clamp(56px, 9dvh, 86px); }
.parade-track .pr { width: clamp(50px, 8dvh, 74px); height: clamp(50px, 8dvh, 74px); }
.home-card { padding: clamp(14px, 2.2dvh, 22px); gap: clamp(10px, 1.6dvh, 16px); }
.watch-entry { padding-top: clamp(10px, 1.6dvh, 14px); }
.room-directory { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; padding: clamp(12px, 2dvh, 20px); }
.room-directory-head { flex: none; }
.room-directory-head h2 { flex: 1; min-width: 0; white-space: nowrap; }
.room-list { flex: 0 1 auto; min-height: 0; overflow: hidden; padding: 2px 4px 4px 0; }
.room-list-status { flex: none; }
.home-foot { flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
.home-inner > .icp-beian { align-self: center; }
@media (max-height: 920px) { .room-directory-hint { display: none; } }
@media (max-height: 760px) { #watchHint { display: none; } }
@media (max-height: 720px) and (orientation: portrait) { .parade { display: none; } }
@media (max-height: 620px) and (orientation: portrait) { .logo-badge { display: none; } }
@media (max-height: 560px) and (orientation: portrait) { .tagline { display: none; } }
@media (max-width: 560px) {
  #home { padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }
  .home-card { padding: 14px; }
  .quick-row, .watch-row, .join-row { flex-wrap: nowrap; gap: 8px; }
  .quick-row .btn.big, .watch-row .watch-btn { flex: 1 1 auto; min-width: 0; padding: 10px 12px; font-size: 15px; }
  .home-card .seg-label { display: none; }
  .home-card .seg button { width: 36px; min-width: 36px; }
  .join-row > .btn { flex: 0 0 auto; padding: 10px 12px; }
  .code-join { flex: 1 1 auto; min-width: 0; }
  .code-join input { letter-spacing: .18em; }
  .room-list-item { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; padding: 9px 10px; }
  .room-list-icon { width: 30px; height: 30px; padding: 5px; }
  .room-list-action { grid-column: auto; flex-direction: column; align-items: stretch; padding-top: 0; border-top: 0; gap: 2px; }
  .room-list-action .btn { min-width: 64px; }
  .room-list-note, .room-list-meta + .room-list-meta { display: none; }
  .room-list-state, .room-list-meta { margin-top: 2px; }
  .home-foot .link { padding: 6px 4px; font-size: 13px; }
}
@media (max-width: 360px) { .home-card .seg button { width: 34px; min-width: 34px; } }
/* 横屏 / 电脑：左边标志 + 公开房间，右边开局卡片 */
@media (min-aspect-ratio: 5/4) and (min-width: 640px) {
  .home-inner {
    width: min(1180px, 100%); display: grid; align-content: center;
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    grid-template-rows: auto auto minmax(0, auto) auto auto;
    column-gap: clamp(20px, 4vw, 60px); row-gap: clamp(8px, 1.8dvh, 18px);
  }
  /* 左栏（标志、角色、公开房间）和右边开局卡片等高，页脚链接横跨两栏居中 */
  .hall-back { position: absolute; left: 0; top: 0; }
  .logo { grid-column: 1; grid-row: 1; }
  .parade { grid-column: 1; grid-row: 2; }
  .room-directory { grid-column: 1; grid-row: 3; align-self: stretch; max-height: 100%; }
  .home-card { grid-column: 2; grid-row: 1 / 4; align-self: center; }
  .home-foot { grid-column: 1 / -1; grid-row: 4; justify-self: center; }
  .home-inner > .icp-beian { grid-column: 1 / -1; grid-row: 5; justify-self: center; }
}
@media (min-aspect-ratio: 5/4) and (max-height: 620px) {
  .home-inner { grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
  .room-directory { align-self: start; }
  .parade, .logo-badge, .tagline { display: none; }
  .logo-text { font-size: clamp(36px, 11dvh, 64px); }
  .home-card { gap: 8px; padding: 12px 14px; }
  .home-card .field { flex-direction: row; align-items: center; gap: 10px; }
  .home-card .field input { flex: 1; min-width: 0; height: 44px; }
  .home-card .btn.big { padding: 8px 14px; font-size: 15px; }
  .home-card .seg button { min-height: 44px; }
  .watch-entry { padding-top: 8px; }
  #watchHint { display: none; }
  .room-directory { padding: 10px 12px; }
  .room-list { margin-top: 6px; }
  .room-list-status { margin-top: 4px; }
}

/* ---------- 房间 ---------- */
#lobby { align-items: center; padding-top: calc(clamp(10px, 2.4dvh, 28px) + env(safe-area-inset-top)); padding-bottom: calc(clamp(10px, 2.4dvh, 28px) + env(safe-area-inset-bottom)); }
.lobby-inner { max-height: 100%; gap: clamp(8px, 2dvh, 22px); }
.room-code { font-size: clamp(34px, 7dvh, 64px); }
.seats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.4dvh, 14px); }
.seat { padding: clamp(8px, 1.4dvh, 16px) 8px clamp(8px, 1.2dvh, 14px); }
.seat .ava { width: clamp(40px, 7dvh, 64px); height: clamp(40px, 7dvh, 64px); margin-bottom: 6px; font-size: clamp(18px, 3dvh, 26px); }
.seat.empty { min-height: clamp(76px, 15dvh, 142px); }
@media (max-width: 1000px) { .seat .ava { margin-top: 4px; } .seat .kick { width: 36px; height: 36px; padding: 7px; } }
@media (max-width: 520px) { .seats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .seat .nm { font-size: 13px; } .seat .tag { font-size: 11px; } }
@media (max-height: 700px) { .lobby-tip { display: none; } .invite-link span { display: none; } }
@media (min-aspect-ratio: 5/4) and (max-height: 560px) {
  .lobby-inner { width: min(900px, 100%); display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); grid-template-rows: auto auto 1fr; align-items: center; column-gap: 20px; row-gap: 8px; }
  .lobby-inner .back { grid-column: 1; grid-row: 1; }
  .room-head { grid-column: 1; grid-row: 2; gap: 4px; }
  .lobby-actions { grid-column: 1; grid-row: 3; align-self: start; }
  .lobby-actions .btn.big { padding: 8px 14px; font-size: 15px; }
  .seats { grid-column: 2; grid-row: 1 / -1; }
  .seat.empty { min-height: 72px; }
  .seat .ava { width: 36px; height: 36px; }
}

/* ---------- 对局：手机竖屏把顶部压成两行，赛道拿到更多高度 ---------- */
@media (max-width: 1000px) and (orientation: portrait) {
  .topbar { flex-wrap: wrap; gap: 4px 6px; padding-bottom: 4px; }
  .races { gap: 4px; }
  .race-pill { padding: 3px 5px; gap: 4px; }
  .top-actions { gap: 4px; }
  .icon-btn { height: 40px; min-width: 40px; padding: 0 6px; }
  .top-title { font-size: 14px; line-height: 1.3; }
  .side { gap: 4px; }
  .players { overflow: visible; padding: 2px 3px 4px 1px; gap: 6px; }
  .prow { flex: 1 1 0; min-width: 0; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 5px; padding: 4px 7px; }
  .prow .pav { width: 30px; height: 30px; }
  .prow .pn b { font-size: 12.5px; }
  .prow .pn b .you, .prow .pn b .auto { font-size: 9px; padding: 0 4px; }
  .prow .sc b { font-size: 16px; }
  .prow .think { right: -2px; top: -7px; font-size: 10px; padding: 0 6px; }
  .prow.cur { transform: none; }
  .emotes { flex-wrap: nowrap; overflow: visible; gap: 4px; padding: 0 1px 2px; }
  .emotes button { flex: 1 1 0; min-width: 0; padding: 3px 2px; font-size: 11.5px; white-space: nowrap; }
  .dock { padding-top: 6px; }
  .prompt { flex-wrap: wrap; gap: 6px 10px; padding: 8px 10px; }
  .prompt .p-ava { width: 36px; height: 36px; }
  .prompt .p-txt { flex: 1 1 150px; }
  .prompt .p-txt b { font-size: 14px; }
  .prompt .p-txt span { font-size: 12px; }
  .prompt .p-opts { width: auto; flex: 1 1 auto; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
  .prompt .p-opts .btn.roll-btn { padding: 10px 14px; }
  .draft { gap: 6px; padding: 4px 2px 0; }
  .draft-head h2 { font-size: 17px; }
  .draft-head p { margin-top: 2px; font-size: 11.5px; text-wrap: balance; }
}
@media (max-width: 480px) and (orientation: portrait) {
  .race-pill .tn { display: none; }
  .race-pill.cur .tn { display: inline; }
}
@media (max-width: 1000px) and (orientation: portrait) and (max-height: 700px) {
  .prompt .p-ava { display: none; }
  .prompt.mine .p-txt { padding-top: 8px; }
  .draft-head p { display: none; }
}

/* ---------- 选秀：卡牌分页，不滚动 ---------- */
.draft { overflow: hidden; justify-content: center; }
.draft > :first-child, .draft > :last-child { margin: 0; }
.draft-head, .draft-order, .my-team, #draftPager { flex: none; }
.draft-cards { flex: 0 1 auto; min-height: 0; overflow: hidden; align-content: flex-start; padding: 6px 6px 8px; }
.draft .my-team { position: relative; }
@media (max-width: 1000px) { .rcard { --w: 136px; } .rcard .tx { font-size: 12px; } }
@media (max-width: 360px) { .rcard { --w: 128px; } }

/* ---------- 浮层：卡牌与结算在一屏内 ---------- */
.ov-box { display: flex; flex-direction: column; align-items: stretch; }
.ov-box > * { flex-shrink: 0; }
.ov-cards { min-height: 0; }
@media (max-height: 760px) {
  .ov-box { padding: 16px 14px; }
  .ov-box h2 { font-size: clamp(20px, 4.4dvh, 30px); }
  .ov-box .sub { margin-top: 4px; font-size: 13px; }
  .ov-cards { margin-top: 10px; gap: 8px; }
  .ov-actions { margin-top: 12px; gap: 8px; }
  .podium { margin-top: 10px; }
  .pod .who { width: 56px; height: 56px; }
  .pod.p1 .blk { height: 70px; font-size: 30px; }
  .pod.p2 .blk { height: 52px; font-size: 26px; }
  .pod.p3 .blk { height: 40px; }
  .standings { margin-top: 10px; gap: 4px; }
  .st-row { padding: 4px 10px; }
  .st-row .rk { width: 24px; height: 24px; }
  .reveal-grid { margin-top: 10px; }
  .pick-status { margin-top: 8px; }
}
@media (max-height: 760px) and (max-width: 1000px) {
  .ov-cards .rcard { --w: 124px; }
  .ov-cards .rcard .art { height: calc(var(--w) * .5); }
  .ov-cards .rcard .nt { display: none; }
  .flip { width: 112px; height: 168px; }
  .flip .rcard { --w: 112px; }
}
@media (max-height: 460px) {
  .podium { display: none; }
  .ov-cards .rcard { --w: 150px; }
  .ov-cards .rcard .art { display: none; }
  .ov-cards .rcard .txt { padding-top: 30px; }
  .ov-cards .rcard .nm { top: 4px; }
  .standings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
}

/* ---------- 弹窗：图鉴 / 玩法说明分页 ---------- */
.modal-head { flex: none; padding: 12px 16px; }
.modal-head h3 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-body { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 14px 16px 16px; }
.gallery, .rules { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.gallery { padding: 2px 6px 8px 2px; grid-template-columns: repeat(auto-fill, minmax(var(--gw, 160px), 1fr)); }
.rules { display: block; columns: 2 380px; column-gap: 22px; }
.rules .rule-sec { break-inside: avoid; margin-bottom: 8px; }
.rule-sec h4, .rules .rule-sec h4:first-child { margin: 4px 0; }
.rule-sec p, .rule-sec ul { margin: 0 0 6px; }
.rules p, .rules li { line-height: 1.6; }
@media (max-width: 1000px) {
  .modal { padding: calc(10px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left)); }
  .modal-head { padding: 8px 10px 8px 14px; gap: 6px; }
  .modal-head h3 { font-size: 16px; }
  .modal-body { padding: 10px; }
  .gallery { --gw: 132px; gap: 8px; }
  .gallery .rcard { --w: 132px; }
  .rules p, .rules li { font-size: 13px; line-height: 1.55; }
  .pg-no { min-width: 36px; }
}

/* ---------- 地图图鉴 ---------- */
.modal-tracks { width: min(1060px, 100%); height: 100%; }
.modal-tracks .modal-body { flex: 1 1 auto; }
.tguide { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.tg-tabs { flex: none; display: flex; gap: 8px; }
.tg-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper); font-weight: 900; font-size: 15px; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), background .2s, color .2s; }
.tg-tabs button svg { width: 20px; height: 20px; }
.tg-tabs button.on { background: var(--green); color: #fff; transform: translateY(-1px); }
.tg-tabs button.wild.on { background: var(--red); }
.tg-tabs button:not(.on):hover { background: var(--yellow); }
.tg-page { flex: 1; min-height: 0; display: grid; gap: 14px; overflow: hidden; }
.tg-page.pg-in-next { animation: pgNext .4s var(--ease) both; }
.tg-page.pg-in-prev { animation: pgPrev .4s var(--ease) both; }
.tg-page.tg-wide { grid-template-rows: minmax(0, 1fr) auto; }
.tg-page.tg-tall { grid-template-rows: minmax(0, 1fr) auto; }
.tg-map { min-height: 0; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.tg-map svg { width: 100%; height: 100%; display: block; filter: drop-shadow(3px 4px 0 rgba(35, 31, 51, .25)); }
.tg-info { min-width: 0; display: grid; gap: 8px; align-content: start; }
.tg-wide .tg-info { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: 16px; }
.tg-wide .tg-intro, .tg-wide .tg-facts { grid-column: 1; }
.tg-wide .tg-legend, .tg-wide .tg-note, .tg-wide .tg-plain { grid-column: 2; }
.tg-wide .tg-legend { grid-row: 1 / span 2; }
.tg-wide .tg-plain { grid-row: 1 / span 2; align-self: center; }
.tg-intro { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--ink2); }
.tg-intro b { display: block; font-size: 22px; font-weight: 900; color: var(--c); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--ink); letter-spacing: .04em; margin-bottom: 2px; }
.tg-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.tg-fact { padding: 6px 10px; border: 2px solid var(--ink); border-radius: 12px; background: var(--bg); box-shadow: var(--shadow-sm); }
.tg-fact > span { display: block; font-size: 11px; font-weight: 900; color: var(--ink2); }
.tg-fact > b { font-size: 26px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tg-fact > small { display: block; font-size: 11px; font-weight: 700; color: var(--ink2); }
.tg-races ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.tg-races li { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.tg-races li b { margin-right: auto; }
.tg-medal { padding: 0 7px; border: 1.5px solid var(--ink); border-radius: 99px; font-size: 12px; font-weight: 900; color: #fff; }
.tg-medal.g { background: var(--gold); }
.tg-medal.s { background: var(--silver); }
.tg-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tg-legend li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 8px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); animation: rise .4s var(--ease) both; }
.tg-legend li:nth-child(2) { animation-delay: .05s; }
.tg-legend li:nth-child(3) { animation-delay: .1s; }
.tg-legend li:nth-child(4) { animation-delay: .15s; }
.tg-legend svg { width: 34px; height: 34px; }
.tg-legend b { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14px; font-weight: 900; }
.tg-legend em { font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--ink2); }
.tg-legend p { margin: 1px 0 0; font-size: 12px; line-height: 1.45; font-weight: 700; }
.tg-note { margin: 0; font-size: 12px; font-weight: 700; line-height: 1.5; color: var(--ink2); }
.tg-plain { padding: 10px 12px; border: 2px dashed var(--line); border-radius: 12px; font-size: 13px; }
@media (max-width: 1000px) {
  .tguide { gap: 8px; }
  .tg-tabs button { font-size: 14px; }
  .tg-page { gap: 8px; }
  .tg-intro { font-size: 12px; }
  .tg-intro b { font-size: 18px; }
  .tg-fact { padding: 4px 8px; }
  .tg-fact > b { font-size: 20px; }
  .tg-races li { font-size: 12px; }
  .tg-legend li { grid-template-columns: 26px minmax(0, 1fr); gap: 6px; padding: 4px 6px; }
  .tg-legend svg { width: 26px; height: 26px; }
  .tg-legend b { font-size: 12.5px; }
  .tg-legend p { font-size: 11px; line-height: 1.4; }
  .tg-note { font-size: 11px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .tg-page.tg-wide { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .tg-wide .tg-info { grid-template-columns: minmax(0, 1fr); }
  .tg-wide .tg-intro, .tg-wide .tg-facts, .tg-wide .tg-legend, .tg-wide .tg-note, .tg-wide .tg-plain { grid-column: 1; grid-row: auto; }
  .tg-legend p, .tg-intro { display: none; }
}

/* 出战 / 选择浮层：卡牌区可收缩，放不下时分页 */
.ov-box > .ov-cards { flex-shrink: 1; overflow: hidden; padding: 4px 6px 8px 2px; align-content: flex-start; }
.ov-pager { align-self: center; margin-top: 8px; }

/* 手机竖屏：赛程和按钮压成一行（标题单独一行） */
@media (max-width: 480px) and (orientation: portrait) {
  .race-pill.cur .tn { display: none; }
  .icon-btn { min-width: 36px; padding: 0 4px; gap: 2px; }
  .top-actions { gap: 3px; }
}
@media (max-width: 380px) and (orientation: portrait) { #speedLabel { display: none; } }

/* 矮屏结算：领奖台收紧，按钮一行 */
@media (max-height: 620px) {
  .pod .rn { display: none; }
  .pod .who { width: 44px; height: 44px; }
  .pod .nm { margin-top: 4px; font-size: 13px; }
  .pod .blk { margin-top: 4px; }
  .pod.p1 .blk { height: 54px; font-size: 24px; }
  .pod.p2 .blk { height: 40px; font-size: 20px; }
  .ov-actions .btn.big { padding: 10px 16px; font-size: 15px; }
  .st-row { padding: 3px 10px; }
  .st-row .tot { font-size: 17px; }
}

/* 分页容器里的格子不能被压扁（overflow:hidden 的卡牌最小高度会被当成 0），溢出才能被量出来 */
.gallery, .rules, .room-list { grid-auto-rows: max-content; }
.tg-medal.s { color: var(--ink); }
/* 矮竖屏首页：昵称标签放到输入框左边，公开房间收紧 */
@media (max-height: 760px) and (orientation: portrait) {
  .home-card .field { flex-direction: row; align-items: center; gap: 10px; }
  .home-card .field input { flex: 1; min-width: 0; height: 44px; }
  .room-directory { padding: 10px 12px; }
  .room-directory-head h2 { font-size: 17px; }
  .room-list-status { margin-top: 6px; }
  .room-list { margin-top: 8px; gap: 8px; }
}
@media (max-height: 860px) and (max-width: 420px) { .parade { display: none; } }
@media (max-width: 400px) { .tagline { font-size: 14px; } }

/* ---------- 手机竖屏：卡牌改成横排（左图右字），整行宽、字更大，一页能放更多张 ---------- */
.rcard .nm2 { display: none; }
@media (max-width: 1000px) and (orientation: portrait) {
  .draft-cards, .ov-box > .ov-cards, .gallery { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 8px; width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
  .draft-cards .rcard, .ov-cards .rcard, .gallery .rcard { --w: 100%; width: 100%; display: grid; grid-template-columns: 76px minmax(0, 1fr); flex: none; }
  .draft-cards .rcard .art, .ov-cards .rcard .art, .gallery .rcard .art { height: auto; min-height: 76px; border-bottom: 0; border-right: 2.5px solid var(--ink); align-items: center; }
  .draft-cards .rcard .art svg, .ov-cards .rcard .art svg, .gallery .rcard .art svg { width: 92%; height: auto; }
  .draft-cards .rcard .art .nm, .ov-cards .rcard .art .nm, .gallery .rcard .art .nm { display: none; }
  .draft-cards .rcard .nm2, .ov-cards .rcard .nm2, .gallery .rcard .nm2 { display: inline; margin-right: 6px; font-size: 15px; font-weight: 900; vertical-align: middle; }
  .draft-cards .rcard .txt, .ov-cards .rcard .txt, .gallery .rcard .txt { min-height: 0; padding: 7px 10px 8px; }
  .draft-cards .rcard .sk, .ov-cards .rcard .sk, .gallery .rcard .sk { vertical-align: middle; margin-bottom: 3px; }
  .draft-cards .rcard .tx, .ov-cards .rcard .tx, .gallery .rcard .tx { font-size: 12.5px; line-height: 1.45; }
  .draft-cards .rcard .nt { font-size: 11px; margin-top: 2px; }
  .rcard.pickable:hover { transform: translateY(-2px); box-shadow: 3px 4px 0 var(--ink); }
  .ov-cards .rcard .owner, .draft-cards .rcard .owner { top: 6px; right: 6px; }
  .prow .pn b { display: block; }
  .prow .pn b .you, .prow .pn b .auto { display: inline-block; margin-left: 3px; vertical-align: 1px; }
  .gallery { padding: 2px 4px 6px 2px; }
}

/* 首页逐级收紧（fitRooms 按需设置 data-tight） */
#home[data-tight="1"] .parade, #home[data-tight="1"] .logo-badge,
#home[data-tight="2"] .parade, #home[data-tight="2"] .logo-badge, #home[data-tight="2"] .tagline,
#home[data-tight="3"] .parade, #home[data-tight="3"] .logo-badge, #home[data-tight="3"] .tagline { display: none; }
#home[data-tight="3"] .logo-text { font-size: clamp(30px, 7dvh, 56px); }
#home[data-tight="3"] .home-inner { gap: 6px; }
#home[data-tight="3"] .home-card { gap: 8px; padding: 10px 12px; }
#home[data-tight="3"] .watch-entry { padding-top: 8px; }
#home[data-tight="3"] .home-foot .link { min-height: 36px; padding-top: 2px; padding-bottom: 2px; }

/* 矮横屏：卡牌去掉插画，只留名字和技能，一页能放下 */
@media (orientation: landscape) and (max-height: 560px) {
  .draft-cards .rcard, .ov-cards .rcard { --w: 176px; }
  .draft-cards .rcard .art, .ov-cards .rcard .art { display: none; }
  .draft-cards .rcard .nm2, .ov-cards .rcard .nm2 { display: inline; margin-right: 6px; font-size: 14px; font-weight: 900; vertical-align: middle; }
  .draft-cards .rcard .txt, .ov-cards .rcard .txt { padding: 6px 8px 7px; }
  .draft-cards .rcard .nt, .ov-cards .rcard .nt { display: none; }
  .draft-cards { gap: 6px; padding-top: 2px; }
  .draft-order { padding-bottom: 2px; }
}
@media (max-width: 1000px) and (max-height: 700px) {
  .mt-slot { width: 40px; height: 40px; }
  .my-team { padding: 4px 8px; }
  .draft-order { padding: 2px 6px 4px; }
}

/* 矮横屏首页：开局按钮和人数选择并排，右栏收窄，左栏留给公开房间 */
@media (min-aspect-ratio: 5/4) and (max-height: 620px) {
  .home-inner { grid-template-columns: minmax(0, 1fr) minmax(0, min(440px, 62vw)); }
  .quick-row, .watch-row, .join-row { flex-wrap: nowrap; gap: 8px; }
  .quick-row .btn.big, .watch-row .watch-btn { flex: 1 1 auto; min-width: 0; padding: 8px 10px; font-size: 15px; }
  .home-card .seg button { width: 40px; min-width: 40px; }
  .join-row > .btn { flex: 0 0 auto; padding: 8px 12px; }
  .code-join { flex: 1 1 auto; min-width: 0; }
  .room-directory-head h2 { font-size: 16px; white-space: nowrap; }
  .room-list-item { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; padding: 8px 9px; }
  .room-list-icon { width: 28px; height: 28px; padding: 5px; }
  .room-list-action { grid-column: auto; flex-direction: column; align-items: stretch; padding-top: 0; border-top: 0; gap: 2px; max-width: none; }
  .room-list-action .btn { min-width: 60px; }
  .room-list-note, .room-list-meta + .room-list-meta { display: none; }
  .room-list-state, .room-list-meta { margin-top: 2px; }
}

/* 矮横屏选秀：卡牌加宽，技能说明两行内放下 */
@media (orientation: landscape) and (max-height: 560px) {
  .draft-cards .rcard, .ov-cards .rcard { --w: min(210px, 31vw); }
  .draft-cards .rcard .tx, .ov-cards .rcard .tx { font-size: 11.5px; line-height: 1.4; }
}

/* 触屏没有真正的悬停，点过的卡牌不要一直歪着 */
@media (hover: none) {
  .rcard.pickable:hover { transform: none; }
}

/* 首页 / 房间的声音开关（对局里用顶栏 #soundBtn） */
.home-foot .sound-toggle { min-width: 44px; justify-content: center; padding-left: 8px; padding-right: 8px; }
.lobby-sound { position: absolute; top: 0; right: 0; z-index: 2; }
@media (max-width: 400px) { .home-foot { gap: 4px 6px; } }
@media (min-aspect-ratio: 5/4) and (max-height: 560px) {
  .lobby-sound { position: static; grid-column: 1; grid-row: 1; justify-self: end; align-self: start; }
}

/* 首页第 4 级收紧：极矮的竖屏（如 375×560）里还要放下一间公开房间 */
#home[data-tight="4"] .parade, #home[data-tight="4"] .logo-badge, #home[data-tight="4"] .tagline, #home[data-tight="4"] .home-card .divider,
#home[data-tight="4"] .room-list-meta, #home[data-tight="4"] .room-list-state, #home[data-tight="4"] .room-list-note, #home[data-tight="4"] #roomDirectoryHint { display: none; }
#home[data-tight="4"] .logo-text { font-size: clamp(26px, 6dvh, 44px); }
#home[data-tight="4"] .home-inner { gap: 4px; }
#home[data-tight="4"] .home-card { gap: 6px; padding: 8px 10px; }
#home[data-tight="4"] .watch-entry { padding-top: 6px; }
#home[data-tight="4"] .home-foot .link { min-height: 36px; padding-top: 2px; padding-bottom: 2px; }
#home[data-tight="4"] .room-directory { padding: 8px 10px; }
#home[data-tight="4"] .room-list { margin-top: 4px; }
#home[data-tight="4"] .room-list-item { padding: 5px 8px; }
/* 矮横屏左栏窄，标题字号同时受宽度约束，不要探出左边 */
@media (min-aspect-ratio: 5/4) and (max-height: 620px) {
  .logo-text { font-size: clamp(28px, min(11dvh, 5.4vw), 64px); }
}
.room-directory-head h2 .ico { flex: none; }

/* === WP-B 局势与新手理解 === */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 顶栏标题：场次 · 轮到谁 · 还有几位到你 */
.top-title .tt-turn { color: var(--ink); }
.top-title .tt-turn.mine { color: var(--red); }
.top-title .tt-cue { color: var(--ink2); font-weight: 800; }
.top-title .tt-cue.soon { color: var(--ink); background: linear-gradient(transparent 58%, rgba(255, 197, 61, .7) 58%); }
.top-title .tt-sep { color: var(--ink3); }
@media (max-width: 1000px) and (orientation: portrait) {
  /* 手机上场次和赛道名已经在赛程胶囊和赛道中央，标题让给「轮到谁 / 还有几位」 */
  .top-title .tt-race, .top-title .tt-race + .tt-sep { display: none; }
}

/* 玩家卡：快轮到你时轻轻脉冲 + 小标签 */
.prow.soon { animation: prowSoon 1.6s ease-in-out infinite; }
.prow .soon-tag { position: absolute; right: -4px; top: -9px; padding: 0 7px; border-radius: 99px; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); font-size: 10.5px; font-weight: 900; line-height: 16px; white-space: nowrap; animation: pop .3s var(--ease); pointer-events: none; }
@keyframes prowSoon { 50% { box-shadow: 2px 2px 0 var(--ink), 0 0 0 4px rgba(255, 197, 61, .6); } }
.prow .pn b .pnm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pnm.clip { text-overflow: clip; }
/* 窄屏玩家卡（4 人以上的手机竖屏）：头像 + 分数一行，名字单独占满一行；AI 用灰字、你用黑底角标 */
@media (max-width: 1000px) and (orientation: portrait) {
  .players.pf-stack .prow { grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: 22px auto; column-gap: 3px; row-gap: 1px; padding: 2px 5px 3px; }
  .players.pf-stack .prow .pav { grid-row: 1; grid-column: 1; width: 22px; height: 22px; border-width: 2px; box-shadow: 0 0 0 1.5px var(--ink); }
  .players.pf-stack .prow .pav .init { font-size: 12px; }
  .players.pf-stack .prow .sc { grid-row: 1; grid-column: 2; align-self: center; }
  .players.pf-stack .prow .sc b { font-size: 15px; }
  .players.pf-stack .prow .pn { grid-row: 2; grid-column: 1 / -1; }
  .players.pf-stack .prow .pn b { display: flex; gap: 2px; font-size: 11.5px; line-height: 14px; }
  .players.pf-stack .prow .pn b .pnm { flex: 0 1 auto; }
  .players.pf-stack .prow .pn b .you { position: absolute; left: 1px; top: 17px; z-index: 1; margin: 0; padding: 0 3px; font-size: 8.5px; line-height: 12px; }
  .players.pf-stack .prow .pn b .auto { display: none; }
  .players.pf-stack .prow.is-ai .pnm { color: var(--ink2); }
  .players.pf-stack .prow .soon-tag { font-size: 9.5px; padding: 0 5px; line-height: 14px; top: -8px; }
}

/* 名次条：还差几格 + 你的选手 */

/* 比赛中赛道中央：标题退到背景，解说贴着行动卡，行动卡是主角 */
.center.hud-race .center-track small { display: none; }
.center.hud-race .center-track b { font-size: calc(28 * var(--u)); opacity: .55; text-shadow: none; -webkit-text-stroke-width: calc(1.5 * var(--u)); }
.center.hud-race .commentary { bottom: calc(6 * var(--u)); }
.board.tall .center.hud-race .commentary { bottom: calc(4 * var(--u)); }

/* 行动卡：右上角「再过 n 位」标签、进度条、行动顺序 */
.turn-card { position: relative; }
.tc-cue { position: absolute; right: calc(10 * var(--u)); top: calc(-1 * var(--u)); z-index: 2; padding: calc(1 * var(--u)) calc(8 * var(--u)) calc(2 * var(--u)); border-radius: 0 0 calc(8 * var(--u)) calc(8 * var(--u)); background: var(--ink); color: #fff; font-size: max(10px, calc(11.5 * var(--u))); font-weight: 900; white-space: nowrap; }
.tc-cue.soon { background: var(--yellow); color: var(--ink); border: calc(1.5 * var(--u)) solid var(--ink); border-top: 0; animation: cueSoon 1.4s ease-in-out infinite; }
.tc-cue.mine { background: var(--red); }
@keyframes cueSoon { 50% { transform: translateY(calc(2 * var(--u))); } }
.tc-who { flex: 1; min-width: 0; padding-right: calc(4 * var(--u)); }
.tc-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-bar { height: calc(4 * var(--u)); background: rgba(35, 31, 51, .12); }
.tc-bar em { display: block; height: 100%; background: var(--c); border-right: calc(1.5 * var(--u)) solid var(--ink); transition: width .4s ease; }
.tc-bar em[style="width:0%"] { border-right: 0; }
.tc-st { display: flex; align-items: center; justify-content: space-between; gap: calc(6 * var(--u)); }
.tc-pos { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-pos.bad { color: var(--red); }
.tc-q { flex: none; display: inline-flex; align-items: center; gap: calc(2 * var(--u)); }
.tc-q .tq { position: relative; display: block; width: calc(20 * var(--u)); height: calc(20 * var(--u)); border-radius: 50%; background: var(--paper); border: calc(2 * var(--u)) solid var(--c); box-shadow: 0 0 0 calc(1 * var(--u)) var(--ink); overflow: hidden; opacity: .8; }
.tc-q .tq svg { width: 118%; height: 118%; margin: -9%; }
.tc-q .tq.now { width: calc(24 * var(--u)); height: calc(24 * var(--u)); opacity: 1; box-shadow: 0 0 0 calc(1.5 * var(--u)) var(--ink), 0 0 0 calc(3.5 * var(--u)) var(--yellow); }
.tc-q .tq.me { opacity: 1; overflow: visible; }
.tc-q .tq.me svg { border-radius: 50%; }
.tc-q .tq em { position: absolute; left: 50%; bottom: calc(-6 * var(--u)); transform: translateX(-50%); padding: 0 calc(3 * var(--u)); border-radius: 99px; background: var(--ink); color: #fff; font-style: normal; font-size: max(8px, calc(8.5 * var(--u))); line-height: 1.25; font-weight: 900; white-space: nowrap; }
.tq-arr { width: calc(5 * var(--u)); height: calc(5 * var(--u)); border-top: calc(1.5 * var(--u)) solid var(--ink3); border-right: calc(1.5 * var(--u)) solid var(--ink3); transform: rotate(45deg); margin: 0 calc(1 * var(--u)) 0 calc(-1 * var(--u)); }
.tq-more { font-size: max(9px, calc(10 * var(--u))); font-weight: 900; color: var(--ink3); margin-left: calc(2 * var(--u)); }

/* 解说条 */
.commentary .com-vis { display: contents; }

/* 选秀顺位条：一行完整可见；当前那手展开成名字 */
.draft-order { overflow: hidden; max-width: 100%; gap: 6px; }
.draft-order .do-row { display: flex; align-items: center; gap: 3px; flex: none; }
.draft-order > * { flex: none; }
.draft-order .do { position: relative; display: flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0; border-radius: 99px; border: 2px solid var(--c); background: var(--paper); color: var(--c); font-size: 11px; font-weight: 900; transform: none; }
.draft-order .do > span { padding: 0 2px; white-space: nowrap; }
.draft-order .do.past { opacity: .35; border-style: solid; background: var(--c); color: #fff; }
.draft-order .do.me:not(.now) { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 0 0 2px var(--c); }
.draft-order .do.now { height: 26px; padding: 0 9px; background: var(--c); color: #fff; border-color: var(--ink); box-shadow: var(--shadow-sm); font-size: 12.5px; animation: doNow .5s var(--ease); max-width: 7.5em; }
.draft-order .do.now > span { overflow: hidden; text-overflow: ellipsis; }
.draft-order .do.now.me { background: var(--red); }
@keyframes doNow { from { transform: scale(.7); } }
.draft-order .do-cue { flex: none; padding: 2px 8px; border-radius: 99px; background: var(--bg2); color: var(--ink2); font-size: 11.5px; font-weight: 900; white-space: nowrap; }
.draft-order .do-cue.soon { background: var(--yellow); color: var(--ink); border: 1.5px solid var(--ink); }
.draft-order .do-cue.mine { background: var(--red); color: #fff; }
.draft-order.fit1 .do:not(.now):not(.me) > span { display: none; }
.draft-order.fit1 .do:not(.now) { min-width: 14px; height: 14px; }
.draft-order.fit1 .do.me:not(.now) { min-width: 18px; height: 18px; font-size: 10px; }
.draft-order.fit2 .do-label { display: none; }
.draft-order.fit3 .do.past { display: none; }

/* 我的队伍：只有新加入的那张弹入；下一个空位斜纹高亮；计数 */
.mt-slot.filled.old { animation: none; }
.mt-slot.filled.fresh { animation: mtIn .5s var(--ease); }
@keyframes mtIn { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 70% { transform: scale(1.08) rotate(2deg); opacity: 1; } }
.mt-slot.next { border-color: var(--ink3); color: var(--ink2); background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255, 197, 61, .18) 6px 12px); }
.mt-label small { display: block; font-size: 10.5px; color: var(--ink3); font-weight: 900; font-variant-numeric: tabular-nums; }

/* 说明卡：分区更清楚，状态带进度条 */
.tip-skill { display: flex; align-items: center; gap: 6px; }
.tip-skill em { font-style: normal; font-size: 10.5px; font-weight: 900; color: var(--ink3); letter-spacing: .1em; }
.tip-body p { font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.tip-pw em { font-style: normal; font-weight: 900; margin-right: 2px; color: var(--purple); }
.tip-st b { color: var(--ink); }
.tip-st i { font-style: normal; color: var(--red); }
.tip-bar { display: block; height: 5px; margin-top: 4px; border-radius: 99px; background: var(--bg2); overflow: hidden; }
.tip-bar em { display: block; height: 100%; background: var(--rc); border-right: 1.5px solid var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .prow.soon, .tc-cue.soon { animation: none; }
  .mt-slot.filled.fresh, .draft-order .do.now { animation: none; }
}

/* === WP-C 决策浮层与庆祝 === */

/* 按下 / 拒绝 / 加载 / 等待 四种按钮反馈 */
.wpc-nudge { animation: wpcNudge .38s ease both; }
@keyframes wpcNudge { 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }
.btn.is-loading { position: relative; }
.btn.is-loading:disabled { opacity: .85; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; flex: none; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.waiting { position: relative; overflow: hidden; }
.btn.waiting:disabled { opacity: .78; }
.btn.waiting::before { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--ink); opacity: .55; transform-origin: left; animation: wpcFill var(--wait, 3s) linear both; }
@keyframes wpcFill { from { transform: scaleX(0); } }
.prompt.locked .btn { opacity: .55; }
.prompt.busy::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 34%; background: var(--blue); border-radius: 0 0 3px 3px; animation: wpcBusy 1.1s ease-in-out infinite; }
@keyframes wpcBusy { from { translate: -100% 0; } to { translate: 300% 0; } }
.timer.urgent { animation: wpcUrgent .5s ease-in-out infinite alternate; }
@keyframes wpcUrgent { to { height: 7px; background: #D8321C; } }

/* 自己的选手跑完：快进到结算 */
.prompt.wpc-done { background: #E9F8EF; }
.prompt.wpc-done .p-txt b::after { content: none; }
.prompt.wpc-done.boost { background: repeating-linear-gradient(115deg, #E9F8EF 0 18px, #D6F1E2 18px 36px); background-size: 200% 100%; animation: rise .35s var(--ease), wpcStreak .6s linear infinite; }
@keyframes wpcStreak { to { background-position: -76px 0; } }
.wpc-skip { animation: breathe 1.6s ease-in-out infinite; }
.wpc-skip .ico { width: 18px; height: 18px; }

/* 可选卡牌：呼吸光边（2 秒一循环），首次轮到自己时第一张挂「点我选人」 */
.rcard.pickable::before { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: 13px; pointer-events: none; box-shadow: inset 0 0 0 3px var(--yellow), inset 0 0 18px rgba(255, 197, 61, .55); opacity: .35; animation: wpcGlow 2s ease-in-out infinite; }
@keyframes wpcGlow { 50% { opacity: 1; } }
.rcard.pickable:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.rcard.tap-hint::after { content: "点我选人"; position: absolute; z-index: 4; right: 6px; top: 6px; padding: 2px 9px; border: 2px solid var(--ink); border-radius: 99px; background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 900; box-shadow: var(--shadow-sm); pointer-events: none; }
.rcard.chosen { animation: wpcChosen .4s var(--ease) both; }
@keyframes wpcChosen { 40% { transform: scale(1.04); } }
.rcard.chosen::before { opacity: 1; animation: none; box-shadow: inset 0 0 0 4px var(--green); }

/* 选择浮层：只有一张候选时的主按钮 */
.wpc-main .ico { width: 20px; height: 20px; }

/* 翻牌：自己的选手 */
.flip.mine .who { color: var(--ink) !important; }
.flip.mine .who::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); vertical-align: 0; }

/* ---------- 单场结算 ---------- */
.me-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 10px; font-style: normal; font-weight: 900; line-height: 1.6; vertical-align: 2px; }
.wpc-results .wpc-note { margin-top: 4px; font-size: 12px; color: var(--red); }
.wpc-pod .who { animation: wpcPop .5s var(--ease) both, podBounce 1s ease-in-out infinite alternate; animation-delay: calc(420ms + var(--k) * 300ms), calc(920ms + var(--k) * 300ms); }
.wpc-pod .blk, .wpc-fpod .blk { transform-origin: bottom; animation: wpcRise .55s var(--ease) both; animation-delay: calc(200ms + var(--k) * 300ms); }
.wpc-pod .nm, .wpc-pod .rn { animation: fadeIn .3s ease both; animation-delay: calc(520ms + var(--k) * 300ms); }
.pod .blk .medal-no { line-height: 1; }
@keyframes wpcPop { 0% { opacity: 0; transform: scale(.3) rotate(-12deg); } 70% { opacity: 1; transform: scale(1.12) rotate(3deg); } }
@keyframes wpcRise { from { transform: scaleY(0); } }
.st-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) 40px 52px 44px; gap: 8px; width: min(560px, 100%); margin: 14px auto -4px; padding: 0 12px; font-size: 11px; font-weight: 800; color: var(--ink3); text-align: left; }
.st-head span:nth-child(n + 3) { text-align: center; }
.st-head span:last-child { text-align: right; }
/* 结算和总决算：按钮行和积分表等宽，上下间距统一 */
.wpc-final .st-head, .wpc-results .st-head { margin-top: 16px; }
.wpc-final .ov-actions, .wpc-results .ov-actions { width: min(560px, 100%); margin: 24px auto 0; flex-wrap: nowrap; }
.wpc-final .ov-actions .btn, .wpc-results .ov-actions .btn { flex: 1 1 0; min-width: 0; justify-content: center; }
.wpc-row { grid-template-columns: 28px minmax(0, 1fr) 40px 52px 44px; gap: 8px; }
.wpc-row.flip-go { transition: translate .6s var(--ease); }
.wpc-row.flip-prep { z-index: 0; }
.wpc-row.me { box-shadow: inset 5px 0 0 var(--c); }
.wpc-row .rk { width: 26px; height: 26px; }
.st-name { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; white-space: nowrap; }
.st-name .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); }
.st-name .nm-t { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 2em; }
.st-name .me-tag { flex: none; margin-left: 0; }
.st-place { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 700; color: var(--ink2); }
.wpc-row .mv { display: inline-flex; align-items: center; justify-content: center; gap: 1px; font-size: 12px; font-weight: 900; opacity: 0; transform: scale(.4); }
.wpc-row .mv svg { width: 14px; height: 14px; }
.wpc-row .mv.up { color: var(--green); }
.wpc-row .mv.down { color: var(--red); }
.wpc-row.settled .mv { opacity: 1; transform: none; transition: opacity .25s ease, transform .35s var(--ease); }
.wpc-row .gain { justify-self: center; min-width: 40px; padding: 1px 6px; border-radius: 99px; text-align: center; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.wpc-row .gain.pos { background: #DDF5E8; border: 1.5px solid var(--ink); color: #137A47; animation: wpcPop .4s var(--ease) both; animation-delay: inherit; }
.wpc-row .gain.zero { color: var(--ink3); }
.wpc-row .tot { text-align: right; }
.tot.landed { animation: wpcBump .35s var(--ease); }
@keyframes wpcBump { 45% { transform: scale(1.3); color: var(--green); } }
.wpc-next { min-width: 118px; }
.wpc-next .cd { min-width: 22px; height: 22px; padding: 0 4px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 12px; line-height: 22px; font-variant-numeric: tabular-nums; }
.wpc-next .cd:empty { display: none; }
.wpc-ring { display: none; }

/* ---------- 终局：2–1–3 领奖台 + 逐场得分表 ---------- */
.wpc-podium { gap: 10px; }
.wpc-fpod { position: relative; width: 138px; }
.wpc-fpod .who { animation: wpcPop .5s var(--ease) both, podBounce 1s ease-in-out infinite alternate; animation-delay: calc(420ms + var(--k) * 300ms), calc(920ms + var(--k) * 300ms); }
.wpc-fpod .blk { animation-delay: calc(200ms + var(--k) * 300ms); }
.wpc-fpod .nm { animation: fadeIn .3s ease both; animation-delay: calc(520ms + var(--k) * 300ms); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod.p3 .blk { background: var(--bronze); color: #fff; font-size: 26px; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; height: 62px; }
.wpc-fpod.p1 .who { width: 108px; height: 108px; }
.wpc-fpod .crown { position: absolute; top: -26px; left: 50%; width: 40px; height: 34px; margin-left: -20px; z-index: 2; animation: wpcCrown .6s var(--ease) both; animation-delay: 1.2s; }
.wpc-fpod .crown svg { width: 100%; height: 100%; fill: var(--yellow); stroke: var(--ink); stroke-width: 2.2; }
@keyframes wpcCrown { 0% { opacity: 0; transform: translateY(-30px) rotate(-25deg) scale(.6); } 70% { opacity: 1; transform: translateY(3px) rotate(6deg) scale(1.1); } }
.pod-sc { font-variant-numeric: tabular-nums; }
.wpc-final.won h2 { background: linear-gradient(transparent 62%, var(--yellow) 62%, var(--yellow) 92%, transparent 92%); display: inline-block; align-self: center; padding: 0 6px; }
.fx-head, .wpc-frow { display: grid; grid-template-columns: 26px minmax(0, 1fr) repeat(var(--races, 4), 40px) 44px; gap: 6px; align-items: center; }
.fx-head { width: min(560px, 100%); margin: 14px auto -4px; padding: 0 12px; font-size: 11px; font-weight: 800; color: var(--ink3); text-align: center; }
.fx-head span:nth-child(2) { text-align: left; }
.fx-head span:last-child { text-align: right; }
.wpc-frow .rk { width: 24px; height: 24px; }
.wpc-frow.me { box-shadow: inset 5px 0 0 var(--c); }
.wpc-frow .st-name { display: block; overflow: hidden; text-overflow: ellipsis; }
.fx-c { justify-self: center; min-width: 30px; padding: 1px 4px; border-radius: 8px; text-align: center; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; animation: pop .3s var(--ease) both; animation-delay: var(--d); }
.fx-c.best { background: var(--yellow); border: 1.5px solid var(--ink); }
.fx-c.z { color: var(--ink3); font-weight: 700; }
.wpc-frow .tot { text-align: right; }
.wpc-again .ico { width: 18px; height: 18px; }
.wpc-wait { align-self: center; }

/* 一屏：矮屏和窄屏逐级收紧 */
@media (max-width: 520px) {
  .wpc-fpod { width: 31%; max-width: 116px; }
  .wpc-fpod .who, .wpc-fpod.p1 .who { width: 60px; height: 60px; }
  .wpc-fpod .crown { top: -20px; width: 30px; height: 26px; margin-left: -15px; }
  .fx-head, .wpc-frow { grid-template-columns: 22px minmax(0, 1fr) repeat(var(--races, 4), 28px) 34px; gap: 4px; }
  .fx-head { padding: 0 8px; font-size: 10px; }
  .wpc-frow { padding-left: 8px; padding-right: 8px; }
  .fx-c { min-width: 24px; padding: 1px 2px; font-size: 12px; }
  .wpc-frow .tot { font-size: 17px; }
  .st-head, .wpc-row { grid-template-columns: 24px minmax(0, 1fr) 30px 44px 34px; gap: 5px; }
  .st-head { padding: 0 8px; }
  .wpc-row { padding-left: 8px; padding-right: 8px; }
  .wpc-row .gain { min-width: 34px; padding: 1px 4px; font-size: 12px; }
  .wpc-row .tot { font-size: 18px; }
  .st-place { display: none; }
}
@media (max-height: 760px) {
  .st-head, .fx-head { margin-top: 8px; }
  .wpc-fpod.p1 .who { width: 64px; height: 64px; }
  .wpc-fpod .who { width: 56px; height: 56px; }
  .pod.p3 .blk { height: 32px; font-size: 20px; }
  .wpc-fpod .crown { top: -20px; width: 30px; height: 26px; margin-left: -15px; }
}
@media (max-height: 620px) {
  .st-head, .fx-head { display: none; }
  .wpc-fpod .who, .wpc-fpod.p1 .who { width: 44px; height: 44px; }
  .pod.p3 .blk { height: 28px; font-size: 18px; }
  .wpc-fpod .crown { top: -16px; width: 24px; height: 20px; margin-left: -12px; }
  .ov-actions .btn { padding-top: 8px; padding-bottom: 8px; }
}
@media (max-height: 460px) {
  .wpc-podium { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rcard.pickable::before { opacity: 1; }
  .wpc-row, .wpc-frow, .fx-c, .wpc-pod .who, .wpc-pod .blk, .wpc-pod .nm, .wpc-pod .rn, .wpc-fpod .who, .wpc-fpod .blk, .wpc-fpod .nm, .wpc-fpod .crown, .wpc-row .gain.pos { animation-delay: 0s !important; }
  .prompt.wpc-done.boost { animation: none; }
}
/* WP-C：手机上终局按钮一行放下，领奖台按人数与屏高收紧 */
@media (max-width: 520px) {
  .wpc-final .ov-actions, .wpc-results .ov-actions { flex-wrap: nowrap; gap: 6px; }
  .wpc-final .ov-actions .btn { padding: 10px 11px; font-size: 14px; gap: 5px; }
  .wpc-final .ov-actions .btn.big { padding: 11px 14px; font-size: 15px; }
  .wpc-final .ov-actions #toHome .ico, .wpc-final .ov-actions #ovClose .ico { display: none; }
  .wpc-final .pod.p1 .blk { height: 78px; font-size: 32px; }
  .wpc-final .pod.p2 .blk { height: 56px; font-size: 26px; }
  .wpc-final .pod.p3 .blk { height: 40px; font-size: 20px; }
  .wpc-final .pod .nm { margin-top: 4px; font-size: 14px; }
  .wpc-final .pod .blk { margin-top: 4px; }
  .wpc-final .podium, .wpc-results .podium { margin-top: 18px; }
  .wpc-final .st-row, .wpc-results .st-row { padding-top: 5px; padding-bottom: 5px; }
}
@media (max-height: 620px) {
  .wpc-final .sub { display: none; }
  .wpc-final .podium, .wpc-results .podium { margin-top: 14px; }
  .wpc-final .pod .blk, .wpc-results .pod .blk { flex-direction: row; align-items: baseline; gap: 4px; }
  .wpc-final .pod.p1 .blk { height: 40px; font-size: 22px; }
  .wpc-final .pod.p2 .blk { height: 30px; font-size: 18px; }
  .wpc-final .pod.p3 .blk { height: 24px; font-size: 16px; }
  .wpc-results .pod.p1 .blk { height: 40px; font-size: 22px; }
  .wpc-results .pod.p2 .blk { height: 30px; font-size: 18px; }
  .wpc-fpod .who, .wpc-fpod.p1 .who, .wpc-pod .who { width: 38px; height: 38px; }
  .wpc-final .pod .nm, .wpc-results .pod .nm { margin-top: 2px; font-size: 12px; }
  .wpc-final .st-row, .wpc-results .st-row { padding-top: 2px; padding-bottom: 2px; }
  .wpc-final .standings, .wpc-results .standings { gap: 3px; margin-top: 8px; }
  .wpc-final .st-row .rk, .wpc-results .st-row .rk { width: 20px; height: 20px; font-size: 11px; }
  .wpc-final .ov-actions, .wpc-results .ov-actions { margin-top: 8px; }
}
/* WP-C：电脑中等屏高（如 1440×900）六人终局：柱子与行距略收，一屏放下 */
@media (min-width: 521px) and (min-height: 761px) and (max-height: 960px) {
  .wpc-final .podium { margin-top: 16px; }
  .wpc-final .pod.p1 .blk { height: 92px; font-size: 36px; }
  .wpc-final .pod.p2 .blk { height: 66px; font-size: 30px; }
  .wpc-final .pod.p3 .blk { height: 48px; font-size: 22px; }
  .wpc-final .pod .nm { margin-top: 6px; }
  .wpc-final .st-row { padding-top: 6px; padding-bottom: 6px; }
}

/* === WP-A 事件动画与因果 === */
/* 棋子：当前行动者放大置顶 + 头顶跳动箭头；同格人多时整体缩小，只留当前行动者的名字签 */
.token { transition: left .17s cubic-bezier(.3, .7, .4, 1), top .17s cubic-bezier(.3, .7, .4, 1), opacity .3s, transform .3s var(--ease), scale .28s var(--ease); }
.token.crowd { scale: .8; }
.board.tall .token.crowd { scale: .74; }
.token.cur { scale: 1.12; }
.token.crowd.cur { scale: .98; }
.board.tall .token.cur { scale: 1.15; }
.board.tall .token.crowd.cur { scale: 1; }
.token.cur::before {
  content: ""; position: absolute; left: 50%; top: -30%; width: 26%; height: 26%;
  margin-left: -13%; background: var(--c); border: calc(2.5 * var(--u)) solid var(--ink); border-top: 0; border-left: 0;
  border-radius: 0 0 calc(4 * var(--u)) 0; rotate: 45deg; z-index: 2;
  animation: curBob .9s ease-in-out infinite;
}
@keyframes curBob { 50% { translate: 0 -32%; } }
.token.cur .seat-dot { opacity: 1; z-index: 3; }
.token.spot .body { animation: spotRing .8s ease-out; }
@keyframes spotRing {
  0% { box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink), 0 0 0 0 rgba(255, 197, 61, .95); }
  100% { box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink), 0 0 0 calc(24 * var(--u)) rgba(255, 197, 61, 0); }
}
.token.sk-cast .body { animation: castRing 1s ease-out; }
@keyframes castRing {
  0%, 100% { box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink), 0 0 0 0 color-mix(in srgb, var(--c) 80%, transparent); }
  30% { box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink), 0 0 0 calc(10 * var(--u)) color-mix(in srgb, var(--c) 75%, transparent), 0 0 calc(18 * var(--u)) calc(10 * var(--u)) rgba(255, 228, 120, .8); }
}
.token.sk-hit { animation: hitShake .5s ease-out; }
.token.sk-hit .body { animation: hitFlash .5s ease-out; }
@keyframes hitShake { 15%, 55% { translate: -8% 0; } 35%, 75% { translate: 8% 0; } }
@keyframes hitFlash { 0%, 100% { filter: none; } 25% { filter: brightness(1.25) drop-shadow(0 0 calc(6 * var(--u)) #F2553C); } }
.token.chip-land .hop { animation: chipLand .4s var(--ease); }
@keyframes chipLand { 40% { scale: 1.16; } }
.token.sync-flash .body { animation: syncFlash .6s ease-in-out 2; }
@keyframes syncFlash { 50% { box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink), 0 0 0 calc(9 * var(--u)) rgba(77, 157, 247, .75); } }

/* 主移动路径预亮 + 落点幽灵棋子 */
.cell.path-lit { animation: pathLit .7s ease-out var(--d, 0ms) both; }
@keyframes pathLit {
  0% { filter: brightness(1); transform: scale(1); }
  35% { filter: brightness(1.35) drop-shadow(0 0 5px #fff); transform: scale(1.07); }
  100% { filter: brightness(1.14); transform: scale(1); }
}
.ghost-token {
  position: absolute; width: calc(58 * var(--u)); height: calc(58 * var(--u)); margin: calc(-29 * var(--u)) 0 0 calc(-29 * var(--u));
  border-radius: 50%; border: calc(3 * var(--u)) dashed var(--c); background: rgba(255, 255, 255, .6);
  box-shadow: 0 0 0 calc(2 * var(--u)) rgba(35, 31, 51, .55); z-index: 1; pointer-events: none;
  animation: ghostIn .26s var(--ease) both, ghostPulse 1s ease-in-out .26s infinite;
}
.board.tall .ghost-token { width: calc(50 * var(--u)); height: calc(50 * var(--u)); margin: calc(-25 * var(--u)) 0 0 calc(-25 * var(--u)); }
.ghost-token .gb { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; opacity: .42; }
.ghost-token .gb svg { width: 118%; height: 118%; margin: -9% 0 0 -9%; }
.ghost-token.out { opacity: 0; transition: opacity .2s; animation: none; }
@keyframes ghostIn { from { opacity: 0; scale: .5; } }
@keyframes ghostPulse { 50% { scale: 1.08; } }

/* 技能提示：照 APK，发动者头顶一个奶白对话气泡，只写技能名 */
.skt {
  position: absolute; z-index: 22; pointer-events: none; translate: -50% -100%; box-sizing: border-box;
  padding: calc(6 * var(--u)) calc(14 * var(--u)) calc(7 * var(--u)); margin-top: calc(-6 * var(--u));
  background: #FFFBEF; border: calc(2.5 * var(--u)) solid var(--ink); border-radius: calc(16 * var(--u));
  box-shadow: 0 calc(3 * var(--u)) 0 rgba(35, 31, 51, .25);
  animation: sktIn .22s var(--ease) both;
}
.skt::after {
  content: ''; position: absolute; left: calc(50% + var(--tail, 0px) - 6 * var(--u)); bottom: calc(-8.5 * var(--u));
  width: calc(11 * var(--u)); height: calc(11 * var(--u)); background: #FFFBEF; border: calc(2.5 * var(--u)) solid var(--ink);
  border-top: 0; border-left: 0; rotate: 45deg; border-radius: 0 0 calc(3 * var(--u)) 0;
}
.skt b { display: block; font-size: calc(15 * var(--u)); font-weight: 900; color: var(--ink); white-space: nowrap; letter-spacing: .04em; }
.skt.out { opacity: 0; transition: opacity .2s; }
@keyframes sktIn { from { opacity: 0; scale: .7; } }

/* 发动者 → 受影响者的弧线；瞬移/换位的轨迹同一套画法 */
.sk-arcs { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 19; }
.sk-arc path { fill: none; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: arcDraw .42s cubic-bezier(.4, 0, .2, 1) forwards; }
.sk-arc .under { stroke: var(--ink); stroke-width: 10; }
.sk-arc .over { stroke: var(--ac, var(--yellow)); stroke-width: 5.5; }
.sk-arc .hit { fill: none; stroke: var(--ac, var(--yellow)); stroke-width: 5; transform-box: fill-box; transform-origin: center; opacity: 0; animation: arcHit .5s ease-out .36s; }
.sk-arc.warp .under, .sk-arc.swap .under, .sk-arc.swap2 .under { stroke-width: 7; opacity: .8; }
.sk-arc.warp .over, .sk-arc.swap .over, .sk-arc.swap2 .over { stroke-width: 3.5; }
.sk-arc.out { opacity: 0; transition: opacity .3s; }
@keyframes arcDraw { to { stroke-dashoffset: 0; } }
@keyframes arcHit { 0% { opacity: 1; scale: .3; } 100% { opacity: 0; scale: 1.5; } }

/* 骰子结果飞向棋子 */
.fly-chip {
  position: fixed; z-index: 60; pointer-events: none; padding: 2px 12px; border-radius: 12px;
  background: var(--yellow); border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  font-weight: 900; font-size: 20px; line-height: 1.3; color: var(--ink);
}

/* 选秀飞卡与补位 */
.rcard.lift { transform: translateY(-8px) scale(1.04) rotate(-1.5deg); box-shadow: 0 0 0 4px var(--c), 6px 10px 0 var(--ink); z-index: 2; }
.rcard.fly-card { position: fixed; margin: 0; z-index: 70; pointer-events: none; box-shadow: 0 0 0 4px var(--c, var(--yellow)), 8px 12px 0 var(--ink); transition: none; }
.fly-land { animation: flyLand .5s var(--ease); }
@keyframes flyLand { 35% { scale: 1.08; filter: brightness(1.12); } }

/* 场次切换：横幅退场后赛道名再淡入 */
.center-track.ct-in { animation: ctIn .45s var(--ease) var(--ctd, 0ms) backwards; }
@keyframes ctIn { from { opacity: 0; transform: translateY(calc(8 * var(--u))) scale(.94); } }

/* 快进提示 */
.sync-hint {
  position: absolute; left: 50%; top: 3%; translate: -50% 0; z-index: 30; pointer-events: none;
  display: flex; align-items: center; gap: calc(6 * var(--u)); padding: calc(5 * var(--u)) calc(14 * var(--u));
  border-radius: 99px; background: var(--ink); color: #fff; border: calc(2 * var(--u)) solid #fff; box-shadow: var(--shadow-sm);
  font-weight: 800; font-size: calc(15 * var(--u)); white-space: nowrap; animation: syncIn .32s var(--ease) both;
}
.board.tall .sync-hint { top: 12%; font-size: calc(17 * var(--u)); }
.sync-hint svg { width: calc(17 * var(--u)); height: calc(17 * var(--u)); color: var(--yellow); }
.sync-hint.out { opacity: 0; transition: opacity .35s; }
@keyframes syncIn { from { opacity: 0; transform: translateY(-40%) scale(.9); } }
@media (prefers-reduced-motion: reduce) {
  .token.cur::before { animation: none; }
  .sk-arcs { display: none; }
}
/* AI 回合跳格更快：跳跃动画与位移同步缩短 */
.token.quick { transition-duration: .12s, .12s, .3s, .3s, .28s; }
.token.quick .hop.go { animation-duration: .12s; }

/* === WP-D 首页房间与异常 === */
/* 连接提示条：贴在顶栏（对局）/离开按钮（房间）下方，首页在最上方的标志区；只有「立即重试」可点 */
.connection-status {
  top: max(calc(var(--wpd-top, 0px) + 6px), calc(10px + env(safe-area-inset-top)));
  padding: 7px 10px 7px 8px; border-width: 2.5px; border-radius: 16px;
  opacity: 0; transform: translateY(-8px) scale(.96); transform-origin: 50% 0;
  transition: opacity .22s ease, transform .32s var(--ease), background .25s;
}
.connection-status:not([hidden]) { display: flex; align-items: center; gap: 8px; }
.connection-status.cs-on { opacity: 1; transform: none; }
.connection-status .cs-ico { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); background: var(--yellow); display: flex; align-items: center; justify-content: center; padding: 3px; }
.connection-status .cs-ico .icon { width: 100%; height: 100%; }
.connection-status[data-kind="wait"] .cs-ico .icon { animation: wpdSpin 1.1s linear infinite; }
.connection-status[data-kind="lost"] { background: #FFE9E4; }
.connection-status[data-kind="lost"] .cs-ico { background: var(--red); color: #fff; animation: wpdBlink 1.6s ease-in-out infinite; }
.connection-status[data-kind="back"] { background: #E3F7EC; }
.connection-status[data-kind="back"] .cs-ico { background: var(--green); color: #fff; animation: pop .4s var(--ease) both; }
.connection-status .cs-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.connection-status .cs-main { font-size: 13px; font-weight: 900; }
.connection-status .cs-sub { font-size: 11.5px; font-weight: 700; color: var(--ink2); }
.connection-status .cs-sub[hidden], .connection-status .cs-retry[hidden] { display: none; }
.connection-status .cs-retry {
  pointer-events: auto; flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 12px 0 9px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--ink); color: #fff; font: inherit; font-size: 13px; font-weight: 900;
  box-shadow: var(--shadow-sm); cursor: pointer; animation: pop .35s var(--ease) both; transition: transform .15s var(--ease);
}
.connection-status .cs-retry .icon { width: 16px; height: 16px; }
.connection-status .cs-retry:active { transform: translate(1px, 1px); box-shadow: none; }
@media (pointer: coarse) { .connection-status .cs-retry { min-height: 40px; } }
@keyframes wpdSpin { to { transform: rotate(360deg); } }
@keyframes wpdBlink { 0%, 100% { transform: none; } 50% { transform: scale(.88); } }

/* toast：首页/房间在底部居中，对局里排在顶栏（和连接提示条）下面，不挡输入框、标题和操作栏 */
body:not([data-screen="game"]) .toasts { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); flex-direction: column; }
body[data-screen="game"] .toasts { top: calc(max(calc(var(--wpd-top, 0px) + 6px), calc(10px + env(safe-area-inset-top))) + var(--wpd-cs-h, 0px)); }
.toast.wpd-toast {
  --toast-ms: 2600ms; --toast-y: -12px;
  display: flex; align-items: center; gap: 8px; max-width: min(440px, calc(100vw - 32px)); padding: 9px 16px; line-height: 1.4; text-align: left;
  animation: wpdToastIn .32s var(--ease) both, wpdToastOut .3s ease-in calc(var(--toast-ms) - 300ms) forwards;
}
body:not([data-screen="game"]) .toast.wpd-toast { --toast-y: 14px; }
.toast.wpd-toast .t-ico { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; border: 2px solid var(--ink); padding: 2px; display: flex; }
.toast.wpd-toast .t-ico .icon { width: 100%; height: 100%; }
@keyframes wpdToastIn { from { opacity: 0; transform: translateY(var(--toast-y)) scale(.96); } }
@keyframes wpdToastOut { to { opacity: 0; transform: translateY(var(--toast-y)) scale(.97); } }

/* 房间码输错：输入框红边 + 抖一下，下方行内说明下一步（占掉分隔线的位置，首页总高基本不变） */
#codeInput[aria-invalid="true"] { border-color: var(--red); background: #FFF1EE; box-shadow: 0 0 0 3px rgba(242, 85, 60, .2); }
#codeInput.wpd-shake { animation: wpdShake .42s ease-in-out; }
@keyframes wpdShake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.home-card.wpd-err .divider { display: none; }
.code-error:not([hidden]) {
  display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 7px 10px; border: 2px solid var(--red); border-radius: 12px;
  background: #FFF1EE; font-size: 12.5px; line-height: 1.4; color: var(--ink); animation: wpdDrop .3s var(--ease) both;
}
.code-error .ce-ico { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--red); }
.code-error .ce-ico .icon { width: 100%; height: 100%; }
.code-error b { font-weight: 900; margin-right: 6px; }
.code-error small { font-size: 12px; font-weight: 700; color: var(--ink2); }
.code-error .ce-text { flex: 1; min-width: 0; }
.code-error .ce-close { flex: none; align-self: center; width: 30px; height: 30px; margin: -4px -4px -4px 0; padding: 7px; display: flex; border: 0; border-radius: 9px; background: transparent; color: var(--ink2); cursor: pointer; }
.code-error .ce-close:hover { background: rgba(242, 85, 60, .14); color: var(--ink); }
.code-error .ce-close .icon { width: 100%; height: 100%; }
.code-error[data-via="link"] { border-color: var(--ink); background: #FFF6DC; box-shadow: var(--shadow-sm); }
@keyframes wpdDrop { from { opacity: 0; transform: translateY(-6px); } }

/* 失效链接：状态行顺带指出路 */
.room-list-status.wpd-hint { color: #B4410E; font-weight: 900; }

/* 房间：自己的座位高亮；受邀者在座位上直接起名，改过名的人点铅笔随时再改 */
.seat.wpd-me { background: #FFFBEF; }
.seat .wpd-nm {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 30px; margin: -5px 0 -3px; padding: 3px 6px;
  border: 0; border-radius: 9px; background: transparent; color: inherit; font-family: inherit; cursor: pointer; transition: background .15s;
}
.seat .wpd-nm span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .wpd-nm .icon { flex: none; width: 13px; height: 13px; color: var(--ink2); transition: transform .2s var(--ease); }
.seat .wpd-nm:hover { background: rgba(255, 197, 61, .35); }
.seat .wpd-nm:hover .icon { transform: rotate(-12deg) scale(1.15); }
.wpd-name { position: relative; display: block; width: 100%; max-width: 168px; margin: 0 auto; }
.wpd-name input {
  width: 100%; min-width: 0; height: 34px; padding: 0 20px 0 6px; border: 2px dashed var(--ink); border-radius: 10px; background: #FFF4CF;
  font: inherit; font-size: 15px; font-weight: 900; text-align: center; color: var(--ink); outline: none; transition: background .15s, box-shadow .15s, border-color .15s;
}
.wpd-name input::placeholder { color: var(--ink3); font-weight: 800; }
.wpd-name input:focus { border-style: solid; background: #fff; box-shadow: 0 0 0 4px rgba(255, 197, 61, .5); }
.wpd-name .icon { position: absolute; right: 5px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; color: var(--ink2); pointer-events: none; }
@media (pointer: coarse) { .wpd-name input { font-size: 16px; height: 38px; } }
.seat .wpd-name-tag { color: #C2410C; font-weight: 900; }
.seat.wpd-unnamed { animation: pop .4s var(--ease) both, wpdNudge 2.4s ease-in-out .8s infinite; }
@keyframes wpdNudge { 0%, 100% { box-shadow: var(--shadow-sm); } 50% { box-shadow: var(--shadow-sm), 0 0 0 5px rgba(255, 197, 61, .6); } }
#copyLink { transition: background .2s, color .2s, transform .15s var(--ease); }
#copyLink.wpd-done { background: var(--green); color: #fff; }
#copyLink .ico .icon { width: 100%; height: 100%; }

/* 首页页脚的声音开关：和左边的文字链接同一套样式，图标 + 档位短标签（音乐 / 音效 / 静音） */
.home-foot .sound-toggle { gap: 6px; padding-left: 8px; padding-right: 10px; }
.home-foot .sound-toggle[data-mode="off"] { color: var(--ink3); }
.home-foot .sound-toggle .sound-label { white-space: nowrap; }
@media (max-width: 400px) {
  .home-foot { flex-wrap: nowrap; gap: 2px; }
  .home-foot .link { padding: 6px 4px; gap: 4px; font-size: 12.5px; white-space: nowrap; }
  .home-foot .sound-toggle { min-width: 44px; padding-left: 4px; padding-right: 4px; }
}

/* 公网 nginx 会在首页页脚后插入备案号（.icp-beian）：固定在首页底部留白里，不占布局高度 */
#home .icp-beian {
  position: fixed; left: 50%; bottom: env(safe-area-inset-bottom); transform: translateX(-50%); z-index: 1;
  height: clamp(10px, 2.6dvh, 28px); display: flex; align-items: center; margin: 0;
  font-size: clamp(9px, 2dvh, 12px); line-height: 1; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .connection-status, .toast.wpd-toast, .code-error, #codeInput.wpd-shake, .seat.wpd-unnamed { animation: none !important; transition: none !important; }
  .connection-status .cs-ico, .connection-status .cs-ico .icon { animation: none !important; }
}

/* === 集成：底栏高度稳定 === */
/* 底栏贴着视口底边。原来的 rise 入场是整条从下方 24px 升上来，位移期间页面会瞬间多出一截可滚动高度
   （手机 866/852、电脑 912/900）。改成原地淡入并轻微缩放，盒子只会变小、不会越过底边；
   文字和按钮在条内上浮，被 .prompt 自身的 overflow:hidden 裁在条里，不计入页面高度。 */
#dock .prompt { animation: dockIn .3s var(--ease); }
#dock .prompt.mine { animation: dockIn .3s var(--ease), mineGlow 1.8s ease-in-out .35s infinite; }
#dock .prompt.wpc-done.boost { animation: dockIn .3s var(--ease), wpcStreak .6s linear infinite; }
#dock .prompt > .p-ava, #dock .prompt > .p-txt, #dock .prompt > .p-opts { animation: dockContent .35s var(--ease) both; }
@keyframes dockIn { from { opacity: 0; transform: scale(.97); } }
@keyframes dockContent { from { opacity: 0; transform: translateY(10px); } }
/* 等待 ↔ 轮到你 切换时高度不跳：「轮到你」角标的位置在所有状态都预留；标题/说明固定行高、单行；
   整条预留到「带掷骰按钮」那一档的高度。多行选项（暗选、数字）本来就更高，不在此列。 */
#dock .prompt .p-txt { padding-top: 6px; }
#dock .prompt .p-txt b, #dock .prompt .p-txt span { line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dock .prompt { min-height: 86px; }
@media (max-width: 1000px) and (orientation: portrait) {
  #dock .prompt { min-height: 70px; }
}
@media (max-width: 1000px) and (orientation: portrait) and (max-height: 700px) {
  #dock .prompt .p-txt { padding-top: 8px; }
}
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 550px) {
  #dock .prompt { min-height: 60px; }
  #dock .prompt .p-opts .btn.roll-btn { padding: 5px 14px; font-size: 16px; }
  #dock .prompt .p-opts .btn.roll-btn .ico { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  #dock .prompt, #dock .prompt > .p-ava, #dock .prompt > .p-txt, #dock .prompt > .p-opts { animation: none; }
}

/* === 打磨：窄屏底栏 === */
/* 360px 一档：说明文字的弹性基准从 150px 收到 96px，让「掷骰子」按钮和文字留在同一排，
   轮到你 / 等待切换时底栏不再从一排跳到两排；按钮文字本身不折行（说明文字已是单行省略）。 */
@media (max-width: 1000px) and (orientation: portrait) {
  #dock .prompt .p-opts .btn.roll-btn { white-space: nowrap; }
}
@media (max-width: 400px) and (orientation: portrait) {
  #dock .prompt .p-txt { flex: 1 1 96px; }
}

/* === 打磨：领奖台 === */
/* 柱子颜色跟名次走（并列第 2 两根都是银色），高度仍按左右位置区分 */
.wpc-fpod.m1 .blk { background: var(--gold); }
.wpc-fpod.m2 .blk { background: var(--silver); }
.wpc-fpod.m3 .blk { background: var(--bronze); }
/* 矮柱：名次和分数并排居中，不再上下挤在 30–40px 的柱子里 */
@media (max-width: 520px), (max-height: 760px) {
  .pod.p3 .blk { flex-direction: row; flex-wrap: wrap; align-content: center; align-items: baseline; justify-content: center; column-gap: 4px; }
}
@media (max-height: 620px) {
  .pod.p2 .blk { flex-direction: row; flex-wrap: wrap; align-content: center; align-items: baseline; justify-content: center; column-gap: 4px; }
  .wpc-final .pod .blk, .wpc-results .pod .blk { flex-wrap: wrap; align-content: center; justify-content: center; }
}

/* ---------- 对齐修复：手机端 ---------- */
/* 大厅「离开」与音乐按钮等高、顶对齐 */
.lobby-inner .back, .lobby-sound { height: 44px; min-height: 44px; box-sizing: border-box; }
.lobby-sound { min-width: 44px; }
/* 选秀「你的队伍」撑满卡牌区宽度，槽位均分 */
@media (max-width: 1000px) {
  .draft .my-team { align-self: stretch; margin-inline: 2px; }
  .draft .my-team .mt-slot { flex: 1 1 0; width: auto; min-width: 0; }
}
/* 360 窄屏：赛程胶囊与五个按钮挤进同一行 */
@media (max-width: 380px) and (orientation: portrait) {
  .races { gap: 3px; }
  .race-pill { padding: 3px 4px; }
  .top-actions { gap: 3px; }
  .icon-btn { min-width: 33px; padding: 0 3px; }
  .icon-btn .ico { width: 17px; height: 17px; }
}

/* 行动卡：实时名次与差距（原技能整块说明腾出的位置） */
.tc-gap { display: flex; align-items: center; gap: calc(7 * var(--u)); margin: calc(8 * var(--u)) calc(11 * var(--u)) 0; font-size: calc(12.5 * var(--u)); font-weight: 800; color: var(--ink2); min-width: 0; }
.tc-gap i { flex: none; font-style: normal; padding: calc(1 * var(--u)) calc(8 * var(--u)); border-radius: 99px; background: var(--ink); color: #fff; font-size: calc(11.5 * var(--u)); font-weight: 900; }
.tc-gap span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-gap.lead i { background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 calc(1.5 * var(--u)) var(--ink); }
.tc-gap.last i { background: var(--ink3); }
/* 玩家卡：左侧色条与棋子底座同色，一眼对上场上是谁 */
.prow { border-left: 7px solid var(--c); padding-left: 8px; }
.prow.me { border-left-width: 7px; }

/* 赛事纪录弹窗 */
.modal-records { width: min(720px, 100%); }
.rec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rec-row { display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: 'no track meds' 'gains gains gains'; gap: 4px 10px; align-items: center; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); }
.rec-row.pending { opacity: .55; grid-template-areas: 'no track wait'; }
.rec-no { grid-area: no; padding: 1px 9px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 900; }
.rec-track { grid-area: track; font-weight: 900; font-size: 14px; }
.rec-wait { grid-column: 3; justify-self: end; font-weight: 800; color: var(--ink2); font-size: 13px; }
.rec-meds { grid-area: meds; display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: flex-end; min-width: 0; }
.rec-med { position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.rec-med i { width: 28px; height: 28px; flex: none; border-radius: 50%; overflow: hidden; background: var(--paper); border: 2.5px solid var(--c); box-shadow: 0 0 0 1.5px var(--ink); }
.rec-med i svg { width: 118%; height: 118%; margin: -9%; }
.rec-med b { position: absolute; left: -4px; top: -5px; min-width: 15px; height: 15px; border-radius: 50%; background: var(--gold, #FFC53D); border: 1.5px solid var(--ink); font-size: 10px; line-height: 12px; text-align: center; font-weight: 900; }
.rec-med.m2 b { background: var(--silver, #C7CCD6); }
.rec-med em { font-style: normal; font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-gains { grid-area: gains; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; font-weight: 800; color: var(--ink2); border-top: 1.5px dashed var(--line); padding-top: 5px; }
.rec-g i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 4px; }
.rec-g b { margin-left: 4px; color: var(--ink); }
.rec-g.me { color: var(--ink); }
.rec-totals { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; padding-top: 10px; border-top: 2.5px solid var(--ink); }
.rec-tl { font-weight: 900; font-size: 13px; color: var(--ink2); }
.rec-t { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: 99px; border: 2px solid var(--c); font-weight: 800; font-size: 13px; background: var(--paper); }
.rec-t em { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: var(--c); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 900; }
.rec-t b { font-size: 15px; margin-left: 2px; }
.rec-t.me { box-shadow: 0 0 0 1.5px var(--ink); }
#races .race-pill { cursor: pointer; }
@media (max-width: 600px) and (orientation: portrait) { #recordsBtn { display: none; } }

/* ================= 模式：一代 / 二代 / 混合 ================= */
/* 模式小徽标：目录、对局场次条、规则书共用；三种模式三种底色 */
.ed-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 1px 7px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); color: var(--ink); font-size: 11px; font-weight: 900; line-height: 1.35; letter-spacing: .04em; white-space: nowrap; }
.ed-badge.ed-v1 { background: #CFEFC4; }
.ed-badge.ed-v2 { background: #FFD3EA; }
.ed-badge.ed-mix { background: linear-gradient(135deg, #CFEFC4 0 48%, #FFD3EA 52% 100%); }
/* 分段选择器（首页、房间、地图图鉴、图鉴筛选）：按钮按文字撑开，悬停/按下有反馈 */
.seg.mode-seg button { width: auto; min-width: 0; padding: 0 13px; font-size: 15px; white-space: nowrap; transition: background .15s, color .15s, transform .12s; }
.seg.mode-seg .seg-label + button, .seg.mode-seg button:first-child { border-left: 0; }
.seg.mode-seg .seg-label { border-right: 2px solid var(--ink); align-self: stretch; display: inline-flex; align-items: center; }
.seg.mode-seg button:not(.on):not(:disabled):hover { background: var(--yellow); }
.seg.mode-seg button:not(.on):not(:disabled):active { transform: translateY(1px); background: #FFB300; }
.seg.mode-seg button.on { background: var(--ink); color: #fff; }
.seg.mode-seg button[data-ed="v2"].on { background: #C2387E; }
.seg.mode-seg button[data-ed="mix"].on { background: var(--purple); }
.seg.mode-seg button:focus-visible { outline: 3px solid var(--blue); outline-offset: -4px; }
.seg.mode-seg.readonly { box-shadow: none; }
.seg.mode-seg.readonly button { cursor: default; }
.seg.mode-seg.readonly button:disabled { color: var(--ink3); opacity: 1; cursor: not-allowed; }
/* 首页：选择器 + 一句话说明同一行 */
.mode-pick { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mode-pick .seg { flex: none; }
.home-card .seg.mode-seg button { width: auto; min-width: 0; padding: 0 13px; }
.mode-hint { margin: 0; flex: 1 1 0; min-width: 0; font-size: 12.5px; font-weight: 700; line-height: 1.4; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) {
  .mode-pick { gap: 8px; }
  .home-card .seg.mode-seg .seg-label { display: none; }
  .home-card .seg.mode-seg button { padding: 0 11px; font-size: 14px; }
  .mode-hint { font-size: 12px; line-height: 1.35; }
}
@media (max-width: 380px) { .home-card .seg.mode-seg button { padding: 0 9px; } }
@media (min-aspect-ratio: 5/4) and (max-height: 620px) {
  .home-card .seg.mode-seg button { min-height: 40px; padding: 0 11px; font-size: 14px; }
  .mode-hint { font-size: 12px; line-height: 1.3; }
}
#home[data-tight="4"] .home-card .seg.mode-seg button { min-height: 40px; }
/* 房间：模式行（房主可切换，其他人只读） */
.lobby-mode { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; max-width: min(520px, 100%); }
.lobby-mode .seg { flex: none; }
.lobby-mode .seg button { min-height: 40px; }
.lobby-mode .mode-hint { text-align: left; max-width: 260px; }
@media (max-width: 520px) { .lobby-mode .seg.mode-seg .seg-label { display: none; } .lobby-mode .seg.mode-seg button { padding: 0 11px; font-size: 14px; } }
@media (max-height: 700px) { .lobby-mode { margin-top: 0; } .lobby-mode .seg button { min-height: 36px; } }
@media (min-aspect-ratio: 5/4) and (max-height: 620px) {
  .lobby-mode { flex-direction: column; gap: 4px; }
  .lobby-mode .mode-hint { flex: none; text-align: center; font-size: 11.5px; -webkit-line-clamp: 2; }
  .lobby-mode .seg.mode-seg .seg-label { display: none; }
}
/* 公开房间：房间码后面的模式徽标 */
.room-list-title .room-list-ed { font-size: 11px; }
/* 对局：场次条最前面的本局模式 */
.races { align-items: center; }
.race-ed { align-self: center; }
.race-pill.tk-twisty .no { background: #C2387E; }
.race-pill.tk-whirly .no { background: var(--blue); }
.top-title .tt-ed { display: none; margin-right: 6px; vertical-align: 2px; }
/* 手机竖屏：赛程胶囊和按钮已占满一行，模式徽标挪到下面的标题行开头（观战时标题隐藏，场次条独占一行，仍放在场次条里） */
@media (max-width: 480px) and (orientation: portrait) {
  #game:not([data-mode="spectator"]) .race-ed { display: none; }
  #game:not([data-mode="spectator"]) .top-title .tt-ed { display: inline-flex; }
}
/* 弹窗标题栏里的计数在窄屏收起，给筛选/模式按钮让位 */
.modal-head .mh-n { font-weight: 800; }
.modal-head .mode-seg { flex: none; }
.modal-head .mode-seg button { min-height: 40px; padding: 0 12px; font-size: 14px; }
@media (max-width: 420px) { .modal-head .mh-n { display: none; } .modal-head .mode-seg button { padding: 0 10px; } }
/* 图鉴筛选：宽屏在标题栏，窄屏在卡片上方 */
.gal-filter.gf-head { display: none; }
.gal-filter.gf-body { flex: none; align-self: center; margin-bottom: 10px; }
.gal-filter.gf-body button { min-height: 38px; padding: 0 18px; font-size: 14px; }
@media (min-width: 600px) { .gal-filter.gf-head { display: inline-flex; } .gal-filter.gf-body { display: none; } }
/* 地图图鉴：二代赛道配色；四条赛道（混合）在窄屏用短名 */
.tg-tabs .tg-short { display: none; }
.tg-tabs button.tk-twisty.on { background: #C2387E; }
.tg-tabs button.tk-whirly.on { background: var(--blue); }
@media (max-width: 760px) {
  .tg-tabs.n4 { gap: 6px; }
  .tg-tabs.n4 button { padding: 6px 6px; gap: 4px; }
  .tg-tabs.n4 .tg-full { display: none; }
  .tg-tabs.n4 .tg-short { display: inline; }
}
@media (max-width: 420px) { .tg-tabs.n4 button svg { display: none; } }
/* 规则书：模式列表与 13 张变数卡（每张一节，分页时整张换页） */
.rules .rule-modes li { margin-bottom: 4px; }
.rules .rule-modes .ed-badge { vertical-align: 1px; margin-right: 2px; }
.rules .rule-sched { color: var(--ink2); font-weight: 700; }
.rules .tw-card { margin-bottom: 6px; padding: 6px 10px; border: 2px dashed #F2A7CE; border-radius: 12px; background: #FFF4FA; }
.rules .tw-card p { margin: 0; font-size: 13px; line-height: 1.5; }
.rules .tw-name { display: inline-block; margin-right: 6px; padding: 0 7px; border: 2px solid var(--ink); border-radius: 8px; background: var(--pink); color: #fff; font-size: 12.5px; font-weight: 900; line-height: 1.5; }
/* 矮横屏图鉴：两列横排卡片（左图右字），长技能说明也能一页放下好几张 */
@media (orientation: landscape) and (max-height: 500px) {
  .modal-gallery .gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: stretch; align-items: start; gap: 8px; }
  .modal-gallery .gallery .rcard { --w: 100%; width: 100%; display: grid; grid-template-columns: 70px minmax(0, 1fr); }
  .modal-gallery .gallery .rcard .art { height: auto; min-height: 70px; border-bottom: 0; border-right: 2.5px solid var(--ink); align-items: center; }
  .modal-gallery .gallery .rcard .art svg { width: 92%; height: auto; }
  .modal-gallery .gallery .rcard .art .nm { display: none; }
  .modal-gallery .gallery .rcard .nm2 { display: inline; margin-right: 6px; font-size: 14px; font-weight: 900; vertical-align: middle; }
  .modal-gallery .gallery .rcard .sk { vertical-align: middle; margin-bottom: 2px; }
  .modal-gallery .gallery .rcard .txt { min-height: 0; padding: 5px 9px 6px; }
  .modal-gallery .gallery .rcard .tx { font-size: 12px; line-height: 1.4; }
  .modal-gallery .gallery .rcard .nt { margin-top: 2px; }
}
/* 矮竖屏大厅：多了模式行，房间码区收紧间距 */
@media (max-height: 620px) and (orientation: portrait) { .room-head { gap: 4px; } }
/* 矮一些的电脑屏（1366×768、1280×720）：开局卡片多了模式行，昵称标签放到输入框左边，让左栏公开房间放得下 */
@media (min-aspect-ratio: 5/4) and (min-width: 640px) and (max-height: 820px) {
  .home-card .field { flex-direction: row; align-items: center; gap: 10px; }
  .home-card .field input { flex: 1; min-width: 0; }
}
/* 大屏手机竖屏（430×932）：多了模式行后角色游行放不下，先收起游行、保留顶部徽章 */
@media (max-height: 940px) and (max-width: 440px) and (orientation: portrait) { .parade { display: none; } }

/* ================= 图鉴：固定弹窗大小与统一卡高 ================= */
/* 弹窗高度不随内容变（一代/二代/全部切换时不再来回跳），卡片统一高度由 galleryPre 量出 */
.modal-gallery { height: min(100%, 860px); }
.modal-gallery .modal-body { flex: 1 1 auto; }
.modal-gallery .gallery { flex: 1 1 auto; align-content: start; }
.modal-gallery .gallery .rcard { min-height: var(--ch, 0); }
/* 卡片是 <button>：统一加高后内容要贴顶排布，不能被按钮垂直居中 */
.modal-gallery .gallery .rcard { display: flex; flex-direction: column; justify-content: flex-start; }
.modal-gallery .gallery .rcard .art { flex: none; height: calc(var(--w) * .56); }
@media (max-width: 1000px) and (orientation: portrait) { .modal-gallery .gallery .rcard { display: grid; align-content: stretch; } .modal-gallery .gallery .rcard .art { height: auto; } .modal-gallery .gallery .rcard .txt { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; } .modal-gallery .gallery .rcard .txt > * { max-width: 100%; } }
@media (max-width: 1000px) and (orientation: landscape) { .modal-gallery .gallery .rcard { display: grid; align-content: start; } .modal-gallery .gallery .rcard .art { height: auto; } }
/* 桌面图鉴：4 列宽卡，文字折行少，统一卡高后每页仍有 8~12 张 */
@media (min-width: 1001px), (min-width: 761px) and (min-height: 501px) and (orientation: landscape) {
  .modal-gallery .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: stretch; }
  .modal-gallery .gallery .rcard { --w: 100%; width: 100%; display: flex; flex-direction: column; }
  .modal-gallery .gallery .rcard .art { flex: 1 1 0; height: auto; min-height: 90px; }
  .modal-gallery .gallery .rcard .txt { flex: none; box-sizing: border-box; height: var(--th, auto); padding: 8px 10px 9px; min-height: 0; }
  .modal-gallery .gallery .rcard .tx { font-size: 12.5px; line-height: 1.42; }
}
/* 手机竖屏列表：头像列收窄，把宽度让给技能文字 */
@media (max-width: 1000px) and (orientation: portrait) {
  .modal-gallery .gallery .rcard { grid-template-columns: 60px minmax(0, 1fr); }
  .modal-gallery .gallery .rcard .art { min-height: 60px; }
  .modal-gallery .gallery .rcard .txt { padding: 6px 9px 7px; }
  .modal-gallery .gallery .rcard .tx { font-size: 12px; line-height: 1.4; }
}

/* =====================================================================
   底部与弹层重构（B 底部操作区 / C 决策弹层 / D 遮罩与按钮风格）
   - 底部 dock：只留 Skin 双行按钮（金黄主 / 浅紫辅），居中；无白卡
   - 决策：86% 深色遮罩 + 内容悬浮；选目标时遮罩留出棋盘并高亮
   - 浮层 / 弹窗统一遮罩色，按钮换 .sk-btn 风格
   ===================================================================== */
:root { --scrim: rgba(22, 18, 38, .86); --dock-min: 76px; --dk-fs: 16px; }

/* ---------- 按钮：行内变体、加载态 ---------- */
.sk-btn { min-height: 44px; }
.sk-btn.inl { flex-direction: row; gap: .5em; }
.sk-btn.inl .sk-t, .sk-btn .sk-t .ico { display: inline-flex; align-items: center; gap: .4em; }
.sk-btn .ico { width: 1.1em; height: 1.1em; flex: none; }
.sk-btn.is-loading::after { content: ""; position: absolute; right: .55em; top: .55em; width: .8em; height: .8em; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.sk-btn.sm { font-size: 13px; padding: .42em .95em .45em; min-width: 0; }
.sk-btn.sm .sk-t { font-size: 1.12em; }

/* ---------- 底部 dock：无白卡，居中按钮 ---------- */
.dock { min-height: var(--dock-min); padding: 6px 0 2px; align-items: flex-start; }
#dock .prompt:not(.decision) {
  min-height: 0; padding: 0; gap: 12px; flex-wrap: nowrap; justify-content: center; overflow: visible;
  background: none; border: 0; border-radius: 0; box-shadow: none;
  animation: dockIn .3s var(--ease);
}
#dock .prompt:not(.decision)::before { content: none; }
#dock .prompt:not(.decision) .p-ava { width: 40px; height: 40px; }
#dock .prompt:not(.decision) .p-txt { flex: 0 1 300px; padding-top: 0; text-align: left; }
#dock .prompt:not(.decision) .p-txt b { font-size: 15px; }
#dock .prompt:not(.decision) .p-txt span { font-size: 12.5px; }
#dock .prompt:not(.decision) .p-opts { flex: 0 1 auto; width: auto; max-height: none; overflow: visible; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 6px 14px; }
#dock .prompt .p-opts .sk-btn { font-size: var(--dk-fs); white-space: nowrap; }
#dock .prompt .p-opts .sk-btn.sm { font-size: calc(var(--dk-fs) - 3px); }
#dock .prompt.wait .p-txt b::after { content: none; }
#dock .prompt:not(.decision) .timer { left: 0; right: auto; bottom: -4px; border-radius: 3px; }
#dock .prompt.locked .sk-btn { opacity: .55; }
#dock .sk-btn.dock-wait { cursor: default; opacity: .72; filter: grayscale(.45); }
#dock .sk-btn.dock-wait .sk-t::after { content: ""; display: inline-block; width: 1.1em; text-align: left; vertical-align: bottom; overflow: hidden; animation: dots 1.2s steps(4) infinite; }
#dock .prompt.wpc-done, #dock .prompt.wpc-done.boost { background: none; animation: dockIn .3s var(--ease); }
#dock .roll-btn, .sk-btn.wpc-skip { animation: dkGlow 1.8s ease-in-out infinite; }
@keyframes dkGlow { 50% { filter: drop-shadow(0 0 9px rgba(255, 197, 61, .95)); } }
/* 手机竖屏：提示句由顶部提示框承担，dock 里的文案保留在 DOM 但不显示 */
@media (max-width: 600px) and (orientation: portrait) {
  :root { --dock-min: 72px; --dk-fs: 15px; }
  #dock .prompt:not(.decision) > .p-txt, #dock .prompt:not(.decision) > .p-ava { display: none; }
}
/* 横屏手机 / 矮屏：只留按钮 */
@media (max-height: 460px) {
  :root { --dock-min: 56px; --dk-fs: 13px; }
  .dock { padding-top: 2px; }
  #dock .prompt:not(.decision) > .p-txt, #dock .prompt:not(.decision) > .p-ava { display: none; }
  .sk-btn { min-height: 40px; }
}

/* ---------- 决策：86% 深色遮罩 + 悬浮内容 ---------- */
#dock .prompt.decision {
  position: fixed; inset: 0; z-index: 46; width: auto; max-width: none; min-height: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-wrap: nowrap; gap: clamp(8px, 2.4vh, 20px);
  padding: calc(12px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background: var(--scrim); border: 0; border-radius: 0; box-shadow: none; overflow: hidden;
  pointer-events: none; color: #fff;
  animation: dcFade .25s ease both;
}
#dock .prompt.decision > .p-opts { pointer-events: auto; }
#dock .prompt.decision::before { content: none; }
@keyframes dcFade { from { opacity: 0; } }
@keyframes dcRise { from { opacity: 0; transform: translateY(14px) scale(.96); } }
#dock .prompt.decision > .dc-stage { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.6vh, 12px); max-width: min(600px, 100%); min-height: 0; text-align: center; animation: dcRise .35s var(--ease) both; }
#dock .prompt.decision .p-ava { width: clamp(40px, 8vh, 60px); height: clamp(40px, 8vh, 60px); margin: 0; border-color: var(--c); box-shadow: 0 0 0 2px #fff, 0 4px 14px rgba(0, 0, 0, .45); background: #fff; }
#dock .prompt.decision .p-txt { flex: none; padding: 0; min-width: 0; max-width: 100%; text-align: center; }
#dock .prompt.decision .p-txt b {
  display: block; white-space: normal; overflow: visible; text-overflow: clip; font-size: clamp(19px, 3.4vh + 6px, 30px); line-height: 1.28; font-weight: 900; color: #fff; letter-spacing: .02em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5), 0 0 14px rgba(0, 0, 0, .55);
}
#dock .prompt.decision .p-txt span { display: block; white-space: normal; overflow: visible; margin-top: 6px; font-size: clamp(13px, 1.9vh + 4px, 16px); line-height: 1.5; font-weight: 700; color: rgba(255, 255, 255, .84); }
#dock .prompt.decision .p-opts { flex: none; width: auto; max-width: min(640px, 100%); max-height: none; overflow: visible; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 6px 16px; animation: dcRise .4s var(--ease) .06s both; }
#dock .prompt.decision .p-opts .sk-btn { min-width: 8.6em; }
#dock .prompt.decision .p-opts .sk-btn.sm { min-width: 0; }
#dock .prompt.decision .timer { position: absolute; left: 0; bottom: 0; right: auto; height: 5px; border-radius: 0 3px 3px 0; background: #FF6B57; box-shadow: 0 0 10px rgba(255, 107, 87, .8); pointer-events: none; }
#dock .prompt.decision .timer.urgent { background: #FFD84F; }

/* 遮罩里的骰子：滚动 → 落定；结果大字「前进 N 格」 */
.dc-art { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 16px); }
.dc-die { display: block; width: clamp(64px, 17vh, 118px); transform-origin: 50% 70%; animation: dcDie .72s cubic-bezier(.2, 1.3, .35, 1) calc(var(--k, 0) * 90ms) both; }
.dc-art.many { gap: min(1.6vw, 12px); max-width: 100%; }
.dc-art.many .dc-die { width: min(10vh, 12.5vw, 76px); }
.dc-die svg.sk { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
@keyframes dcDie {
  0% { opacity: 0; transform: translateY(-46px) rotate(-340deg) scale(.5); }
  45% { opacity: 1; transform: translateY(8px) rotate(24deg) scale(1.1); }
  70% { transform: translateY(-5px) rotate(-8deg) scale(.98); }
  100% { transform: none; }
}
.dc-big {
  font-size: clamp(26px, 5.4vh, 42px); font-weight: 900; letter-spacing: .06em; line-height: 1.1; color: #FFD84F;
  -webkit-text-stroke: 3px #231F33; paint-order: stroke fill; text-shadow: 0 4px 0 rgba(0, 0, 0, .45);
  animation: dcBig .5s var(--ease) .42s both;
}
@keyframes dcBig { from { opacity: 0; transform: scale(.6); } 60% { transform: scale(1.12); } }
.dc-nums { display: grid; grid-template-columns: repeat(6, auto); gap: clamp(6px, 1.6vw, 12px); justify-content: center; }
.dc-num { position: relative; width: clamp(50px, 13vw, 66px); padding: 0; border: 0; background: none; cursor: pointer; border-radius: 14px; touch-action: manipulation; transition: transform .25s var(--ease), filter .15s; }
.dc-num svg.sk { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.dc-num b { position: absolute; right: -2px; bottom: -4px; min-width: 20px; padding: 0 5px; border-radius: 99px; background: #FFD84F; color: #231F33; border: 2px solid #231F33; font-size: 12px; line-height: 16px; text-align: center; font-weight: 900; }
.dc-num:hover { transform: translateY(-3px) rotate(-4deg); filter: brightness(1.06); }
.dc-num:active { transform: translateY(1px) scale(.95); }
.dc-num:focus-visible { outline: 3px solid #4D9DF7; outline-offset: 3px; }
.dc-num:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 380px) { .dc-nums { grid-template-columns: repeat(3, auto); } .dc-num { width: 56px; } }
@media (max-height: 460px) {
  #dock .prompt.decision { flex-direction: row; flex-wrap: wrap; gap: 6px 22px; }
  #dock .prompt.decision .p-ava { display: none; }
  .dc-die { width: clamp(44px, 14vh, 70px); }
  .dc-nums { grid-template-columns: repeat(6, auto); }
  .dc-num { width: 44px; }
  #dock .prompt.decision .p-txt b { font-size: 17px; }
  #dock .prompt.decision .p-txt span { margin-top: 2px; font-size: 12px; }
}

/* 选目标：遮罩留出棋盘，棋盘上的可选格 / 棋子黄环呼吸，按钮收在下方 */
#dock .prompt.decision.pick-board { background: none; justify-content: flex-end; gap: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
#dock .prompt.decision.pick-board::before {
  content: ""; position: fixed; left: var(--sx, 0); top: var(--sy, 0); width: var(--sw, 0); height: var(--sh, 0);
  background: none; padding: 0; border-radius: 12px; box-shadow: 0 0 0 150vmax var(--scrim); pointer-events: none; z-index: -1; animation: none;
}
#dock .prompt.decision.pick-board > .dc-stage {
  max-width: min(640px, 100%); padding: 8px 16px 9px; border-radius: 16px; gap: 2px;
  background: rgba(22, 18, 38, .9); box-shadow: 0 0 0 1.5px rgba(255, 216, 79, .55), 0 6px 18px rgba(0, 0, 0, .5);
}
#dock .prompt.decision.pick-board .p-ava { display: none; }
#dock .prompt.decision.pick-board .p-txt b { font-size: clamp(15px, 2.4vh + 6px, 20px); line-height: 1.3; }
#dock .prompt.decision.pick-board .p-txt span { margin-top: 1px; font-size: clamp(11.5px, 1.6vh + 3px, 13.5px); line-height: 1.35; }
#dock .prompt.decision.pick-board .p-opts { gap: 4px 10px; }
#dock .prompt.decision.pick-board .p-opts .sk-btn { font-size: 14px; min-width: 0; }
#dock .prompt.decision.pick-board .p-opts .sk-btn.sm { font-size: 12.5px; }
@media (max-height: 460px) {
  #dock .prompt.decision.pick-board { flex-direction: row; justify-content: center; align-items: flex-end; flex-wrap: nowrap; gap: 10px; }
  #dock .prompt.decision.pick-board > .dc-stage { flex: 0 1 46%; }
  #dock .prompt.decision.pick-board .p-opts { flex: 0 1 50%; justify-content: flex-start; }
}
#board.spot .cell:not(.pick) { filter: brightness(.5) saturate(.6); }
#board.spot .cell.pick { animation: dcCell 1.1s ease-in-out infinite; filter: none; }
#board.spot .cell.pick > rect:first-child { stroke: #FFD84F; stroke-width: 6; }
#board.spot .token:not(.selectable) { opacity: .45; filter: grayscale(.35); }
#board.spot .token.selectable { z-index: 12; filter: drop-shadow(0 0 calc(7 * var(--u)) #FFD84F); }
#board.spot .token.selectable .body { animation: dcTok 1.1s ease-in-out infinite; }
@keyframes dcCell { 50% { transform: scale(1.1); filter: brightness(1.15) drop-shadow(0 0 7px #FFD84F); } }
@keyframes dcTok { 0%, 100% { box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink), 0 0 0 calc(5 * var(--u)) #FFD84F; } 50% { box-shadow: 0 0 0 calc(2 * var(--u)) var(--ink), 0 0 0 calc(10 * var(--u)) rgba(255, 216, 79, .75); } }

/* 骰子区：Skin 骰子 + 「前进 N 格」大字（名字挪到骰子上方） */
.die.sk-die svg.sk { height: 100%; width: 100%; }
.die.sk-die .die-cap { top: auto; bottom: 100%; transform: translate(-50%, -4px); }
.die-n {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, calc(4 * var(--u))); white-space: nowrap;
  font-size: calc(22 * var(--u)); font-weight: 900; letter-spacing: .05em; line-height: 1.1; color: #FFD84F;
  -webkit-text-stroke: calc(3 * var(--u)) var(--ink); paint-order: stroke fill; text-shadow: calc(2 * var(--u)) calc(3 * var(--u)) 0 rgba(35, 31, 51, .6);
  animation: dcBig .5s var(--ease) .12s both;
}

/* ---------- 浮层 / 弹窗：统一深色遮罩，按钮 Skin 化 ---------- */
.overlay, .modal { background: var(--scrim); backdrop-filter: none; -webkit-backdrop-filter: none; }
.ov-actions .sk-btn { font-size: 15px; min-width: 0; }
.wpc-final .ov-actions .sk-btn, .wpc-results .ov-actions .sk-btn { flex: 1 1 0; justify-content: center; }
.ov-actions .sk-btn .ico { width: 1.2em; height: 1.2em; }
.ov-actions { padding-bottom: 6px; align-items: flex-start; }
.wpc-next { min-width: 118px; }
.wpc-next .cd { background: var(--sk-ink); color: #fff; }
.modal-head #mClose { background: linear-gradient(180deg, var(--sk-gold-1), var(--sk-gold-2)); border: 2.5px solid var(--sk-ink); box-shadow: 0 3px 0 var(--sk-gold-edge), 0 3px 0 2.5px var(--sk-ink); min-width: 44px; height: 42px; border-radius: 14px; }
.modal-head #mClose:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sk-gold-edge), 0 1px 0 2.5px var(--sk-ink); }
.modal-head #mClose:focus-visible { outline: 3px solid #4D9DF7; outline-offset: 3px; }
@media (max-height: 460px) { .ov-actions .sk-btn { font-size: 13px; } }

@media (prefers-reduced-motion: reduce) {
  .dc-die, .dc-big, .die-n, #dock .prompt.decision, #dock .prompt.decision > .dc-stage, #dock .prompt.decision .p-opts,
  #board.spot .cell.pick, #board.spot .token.selectable .body, #dock .roll-btn, .sk-btn.wpc-skip { animation: none; }
}
#board.spot .center, #board.spot .turn-card { opacity: .38; transition: opacity .25s; }

/* ================= 手机端上半部重构：顶栏单行 / 提示框 / 玩家栏等宽卡 / 「更多」「聊天」弹层 =================
   仅 ≤600px 竖屏生效；桌面与横屏只多出被隐藏的新节点。参照 APK 的信息架构，素材全部是自家的 skin / art。 */
.tb-more { display: none; }
.tb-chat[hidden] { display: none; }
.topbar > .tb-chat { order: 2; }
.top-title .tb-do, .top-title .tb-end { display: none; }
.top-actions .lbl, .top-actions .st { display: none; }
.topbar > #leaveGame { order: 2; }
@media (min-width: 1001px) { .topbar > #leaveGame { margin-left: -6px; } }

@media (max-width: 600px) and (orientation: portrait) {
  #game { position: relative; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); }
  #game .topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 6px; }
  #game .topbar > #leaveGame { order: 1; }
  #game .topbar > .races { order: 2; flex: 1 1 0; width: auto; min-width: 0; justify-content: center; gap: 4px; }
  #game .topbar > .tb-more { order: 3; }
  #game .topbar > .tb-chat { order: 4; }
  #game .topbar > .spectator-status { order: 5; flex: 1 0 100%; }
  #game .topbar > .top-title { order: 6; flex: 1 0 100%; }
  #game .topbar > .icon-btn { display: inline-flex; flex: none; width: 40px; height: 40px; min-width: 40px; padding: 0; justify-content: center; border-radius: 13px; }
  #game .topbar > .icon-btn .ico { width: 21px; height: 21px; }
  #game .topbar > .icon-btn[aria-expanded="true"] { background: var(--yellow); transform: translate(1px, 1px); box-shadow: none; }
  #game .topbar > .tb-chat[hidden] { display: none; }

  /* 场次胶囊：只留序号圆，当前场黄底；模式徽标回到胶囊条最前面 */
  #game .topbar .race-ed { display: inline-flex; flex: none; }
  #game .race-pill { position: relative; flex: none; width: 34px; height: 34px; padding: 0; gap: 0; justify-content: center; border-radius: 50%; }
  #game .race-pill::after { content: ''; position: absolute; inset: -3px; }
  #game .race-pill .no { width: 24px; height: 24px; font-size: 12px; }
  #game .race-pill .tn, #game .race-pill .pts { display: none; }

  /* 「更多」弹层：.top-actions 本体，点按钮展开 */
  #game .top-actions {
    display: none; position: absolute; z-index: 60; top: 54px; right: 8px; width: min(264px, calc(100% - 16px)); margin: 0;
    flex-direction: column; gap: 6px; padding: 10px; box-sizing: border-box; transform-origin: 85% 0;
    background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 5px 0 var(--ink);
  }
  #game .top-actions.open { display: flex; animation: tbPop .24s cubic-bezier(.2, 1.5, .35, 1) both; }
  #game .top-actions .icon-btn { width: 100%; height: 46px; min-width: 0; padding: 0 12px; gap: 10px; justify-content: flex-start; border-radius: 12px; font-size: 15px; font-weight: 800; box-shadow: 0 2px 0 var(--ink); }
  #game .top-actions .icon-btn[hidden] { display: none; }
  #game .top-actions .icon-btn .ico { flex: none; width: 21px; height: 21px; }
  #game .top-actions .icon-btn .lbl, #game .top-actions .icon-btn b { display: inline; font-weight: 800; }
  #game .top-actions .icon-btn .lbl, #game .top-actions #autoBtn b { flex: 1 1 auto; text-align: left; }
  #game .top-actions #speedLabel, #game .top-actions .st { display: inline; flex: none; min-width: 2.6em; padding: 1px 8px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 900; text-align: center; }
  #game .top-actions #autoBtn::after { content: '关'; flex: none; min-width: 2.6em; padding: 1px 8px; border-radius: 99px; background: var(--line); color: var(--ink2); font-size: 12.5px; font-weight: 900; text-align: center; }
  #game .top-actions #autoBtn[aria-pressed="true"]::after { content: '开'; background: var(--ink); color: #fff; }
  #game .top-actions .icon-btn:disabled { opacity: .5; }
  #game #recordsBtn { display: inline-flex; }

  /* 快捷聊天弹层：#emotes 本体，点一个发出并收起 */
  #game #emotes {
    display: none; position: absolute; z-index: 60; top: 54px; right: 8px; width: min(288px, calc(100% - 16px)); box-sizing: border-box;
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; transform-origin: 85% 0;
    background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 5px 0 var(--ink); overflow: visible;
  }
  #game #emotes.open { display: grid; animation: tbPop .24s cubic-bezier(.2, 1.5, .35, 1) both; }
  #game #emotes[hidden] { display: none; }
  #game #emotes button { flex: none; min-width: 0; min-height: 44px; padding: 0 4px; font-size: 15px; border-radius: 12px; box-shadow: 0 2px 0 var(--ink); }

  /* 观战状态条：紧贴在提示框上方，单行省略 */
  #game .spectator-status { gap: 6px; justify-content: center; min-height: 20px; padding: 0 2px; font-size: 11px; line-height: 20px; }
  #game .spectator-status .spectator-code { margin-left: 0; padding: 0 6px; line-height: 17px; border-width: 1.5px; border-radius: 7px; flex: none; }
  #game .spectator-status > .ico { width: 15px; height: 15px; }
  #game #spectatorLabel { overflow: hidden; text-overflow: ellipsis; }

  /* 提示框：#topTitle 本体。左侧色点 = 当前行动者玩家色；右侧旗帜 + 第 N/4 场 */
  #game .topbar .top-title, #game[data-mode="spectator"] .topbar .top-title {
    position: relative; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
    min-height: 48px; padding: 4px 88px 4px 30px; overflow: visible; white-space: normal; text-overflow: clip;
    background: #FFF8E8; border: 2.5px solid var(--ink); border-radius: 14px; text-align: center;
    box-shadow: inset 0 0 0 2px #FFF8E8, inset 0 0 0 3.2px rgba(35, 31, 51, .85), 2px 3px 0 rgba(35, 31, 51, .9);
    font-size: 14px; line-height: 1.2; font-weight: 900;
  }
  #game .topbar .top-title::before { content: ''; position: absolute; left: 12px; top: 50%; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%; background: var(--c, #C9C3D9); border: 2px solid var(--ink); }
  #game .topbar .top-title[data-mine="1"] { background: #FFF1B8; box-shadow: inset 0 0 0 2px #FFF1B8, inset 0 0 0 3.2px rgba(35, 31, 51, .85), 2px 3px 0 rgba(35, 31, 51, .9); animation: tbMine 1.6s ease-in-out infinite; }
  #game .topbar .top-title .tt-ed, #game .topbar .top-title .tt-plain, #game .topbar .top-title .tt-race, #game .topbar .top-title .tt-sep,
  #game .topbar .top-title .tt-turn, #game .topbar .top-title .tt-cue { display: none; }
  #game .topbar .top-title .tb-do { display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 100%; }
  #game .topbar .top-title .tb-main { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; font-size: 14.5px; }
  #game .topbar .top-title .tb-cue { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; color: var(--ink2); }
  #game .topbar .top-title .tb-end { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 900; line-height: 1; white-space: nowrap; }
  #game .topbar .top-title .tb-end svg { width: 22px; height: auto; flex: none; }

  /* 玩家栏：全员等宽一横排，圆头像 + ★积分 + 玩家色名字条 */
  #game .side { gap: 0; }
  #game .players { flex-direction: row; justify-content: center; align-items: stretch; flex-wrap: nowrap; gap: 4px; overflow: visible; padding: 13px 2px 7px; }
  #game .players .prow {
    flex: 1 1 0; min-width: 0; max-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 0;
    padding: 6px 3px 0; background: #FFF8E8; border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink);
    transition: transform .3s cubic-bezier(.2, 1.5, .35, 1), box-shadow .2s, background .2s;
  }
  #game .players .prow.me { border-width: 2.5px; }
  #game .players .prow.cur { transform: translateY(-4px); background: #FFF3C4; box-shadow: 0 0 0 3px var(--c), 2px 6px 0 3px var(--ink); animation: tbActive 1.4s ease-in-out infinite; }
  #game .players .prow .pav { order: 1; flex: none; width: min(44px, 78%); height: auto; aspect-ratio: 1; margin: 0 0 3px; border: 3px solid var(--c); box-shadow: 0 0 0 2px var(--ink); }
  #game .players .prow .pav .init { font-size: 17px; }
  #game .players .prow .sc { order: 2; display: flex; align-items: center; justify-content: center; gap: 2px; padding: 0 0 4px; text-align: center; }
  #game .players .prow .sc .sk-star { display: block; width: 14px; height: 14px; flex: none; }
  #game .players .prow .sc .sk-star svg { display: block; width: 100%; height: 100%; }
  #game .players .prow .sc b { display: inline; font-size: 14px; line-height: 1; }
  #game .players .prow .sc span { display: none; }
  #game .players .prow .pn { order: 3; align-self: stretch; width: auto; margin: 0 -3px; min-width: 0; }
  #game .players .prow .pn .pline, #game .players .prow .pn .hand { display: none; }
  #game .players .prow .pn b {
    display: block; padding: 3px 2px 4px; background-color: var(--c); border-top: 2.5px solid var(--ink); border-radius: 0 0 9px 9px;
    color: #fff; font-size: 11.5px; line-height: 1.2; letter-spacing: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-shadow: 0 1.5px 0 rgba(35, 31, 51, .55), 1px 0 0 rgba(35, 31, 51, .35), -1px 0 0 rgba(35, 31, 51, .35);
    background-image: radial-gradient(circle at 25% 35%, rgba(255, 255, 255, .16) 0 1px, transparent 1.6px), linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(0, 0, 0, .1));
    background-size: 6px 6px, 100% 100%;
  }
  #game .players .prow .pn b .pnm { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: inherit !important; }
  #game .players .prow.is-ai .pn b .pnm { color: #fff; }
  #game .players .prow .pn b .you, #game .players .prow .pn b .auto {
    position: absolute; z-index: 3; top: -8px; margin: 0; padding: 0 5px; font-size: 10px; line-height: 15px; white-space: nowrap;
    border: 1.5px solid var(--ink); border-radius: 99px; pointer-events: none;
  }
  #game .players .prow .pn b .you { left: -4px; background: var(--ink); color: #fff; text-shadow: none; border-color: #fff; box-shadow: 0 0 0 1.5px var(--ink); }
  #game .players .prow .pn b .auto { right: -4px; background: #fff; color: var(--ink2); text-shadow: none; }
  #game .players .prow .pn b .auto.ai { display: none; }
  #game .players .prow .pn b .you .you-auto { display: inline; }
  #game .players .prow .pn b .you + .auto { display: none; }
  #game .players .prow .pn b .auto { left: -4px; right: auto; font-size: 0; }
  #game .players .prow .pn b .auto::after { content: attr(data-short); font-size: 10px; }
  #game .players .prow .think { z-index: 4; top: -9px; right: -5px; padding: 0 5px; font-size: 9.5px; line-height: 14px; border-width: 1.5px; }
  #game .players .prow .soon-tag { display: none; }
  #game .players .prow .bubble { left: 0; right: 0; width: max-content; max-width: 150%; margin: 0 auto; top: -26px; font-size: 13px; padding: 3px 9px; }
  #game .players .prow .pav, #game .players .prow .hand i { cursor: pointer; }
}
@media (max-width: 600px) and (orientation: portrait) and (max-height: 700px) {
  #game .topbar { padding-bottom: 4px; }
  #game .topbar .top-title { min-height: 44px; }
  #game .players { padding: 12px 2px 5px; }
  #game .players .prow { padding-top: 4px; }
  #game .players .prow .pav { width: min(38px, 74%); margin-bottom: 2px; }
  #game .players .prow .sc { padding-bottom: 3px; }
}
@keyframes tbPop { from { opacity: 0; transform: scale(.82) translateY(-8px); } }
@keyframes tbActive { 50% { box-shadow: 0 0 0 5px var(--c), 2px 7px 0 3px var(--ink); } }
@keyframes tbMine { 50% { filter: brightness(1.04) saturate(1.15); } }
@media (prefers-reduced-motion: reduce) {
  #game .top-actions.open, #game #emotes.open, #game .players .prow.cur, #game .topbar .top-title[data-mine="1"] { animation: none; }
}
@media (max-width: 340px) and (orientation: portrait) {
  #game .topbar { gap: 3px; }
  #game .topbar > .icon-btn { width: 36px; min-width: 36px; height: 36px; }
  #game .topbar > .races { gap: 3px; }
  #game .race-pill { width: 30px; height: 30px; }
  #game .race-pill .no { width: 21px; height: 21px; font-size: 11px; }
  #game .race-ed { padding: 1px 5px; font-size: 10px; }
}
/* 超矮手机竖屏（如 375×560）：压缩提示框与玩家卡，给选秀卡牌/赛道让高度 */
@media (max-width: 600px) and (orientation: portrait) and (max-height: 600px) {
  #game .topbar { padding-bottom: 3px; }
  #game .topbar .top-title { min-height: 38px; padding-top: 2px; padding-bottom: 2px; }
  #game .topbar .top-title .tb-cue { display: none; }
  #game .players { padding: 11px 2px 3px; }
  #game .players .prow { padding-top: 3px; }
  #game .players .prow .pav { width: min(30px, 64%); margin-bottom: 1px; border-width: 2.5px; }
  #game .players .prow .pav .init { font-size: 14px; }
  #game .players .prow .sc { padding-bottom: 2px; }
  #game .players .prow .pn b { padding: 2px 2px 3px; font-size: 11px; }
}

/* 手机横屏：顶栏内容再宽也不能撑宽页面（否则手机浏览器会整体缩小，点击错位） */
@media (max-width: 1000px) { #game { grid-template-columns: minmax(0, 1fr); } #game > * { min-width: 0; } .topbar { min-width: 0; overflow: hidden; } }

/* 手机竖屏蛇形赛道：下半部 = 左边标题/骰子/解说 + 右边领奖台，底部整宽行动卡 */
.board.tall .center { gap: calc(6 * var(--u)); }
.board.tall .center-main { flex: none; width: 66%; height: calc(86 * var(--u)); }
.board.tall .turn-card { flex: 1 1 0; min-height: 0; }
.board.tall .tc-ava { width: calc(40 * var(--u)); height: calc(40 * var(--u)); }
.board.tall .tc-head { padding: calc(4 * var(--u)) calc(10 * var(--u)); }
.board.tall .tc-who b { font-size: calc(18 * var(--u)); margin-top: 0; }
.board.tall .tc-skill { padding: calc(6 * var(--u)) calc(11 * var(--u)) calc(2 * var(--u)); }
.board.tall .tc-skill p { margin-top: calc(3 * var(--u)); font-size: calc(13 * var(--u)); line-height: 1.35; }
.board.tall .tc-st { margin-bottom: calc(6 * var(--u)); padding-top: calc(4 * var(--u)); }
.board.tall .tc-head { padding: calc(3 * var(--u)) calc(10 * var(--u)); }
.board.tall .tc-skill { padding: calc(3 * var(--u)) calc(11 * var(--u)) 0; }
.board.tall .tc-gap { margin-top: calc(3 * var(--u)); }
.board.tall .tc-st { margin-bottom: calc(4 * var(--u)); margin-top: calc(3 * var(--u)); padding-top: calc(3 * var(--u)); }
.board.tall .center-main { height: calc(80 * var(--u)); }
.board.tall .tc-ava { width: calc(34 * var(--u)); height: calc(34 * var(--u)); }
.board.tall .tc-st { margin-bottom: calc(3 * var(--u)); }
.board.tall .tc-who b { line-height: 1.1; }
.board.tall .tc-player { line-height: 1.25; }
.board.tall .center-main { height: calc(77 * var(--u)); }

/* 选秀：被选走的卡留在原位置灰，右上角标明是哪位玩家选的 */
.rcard.taken { cursor: default; pointer-events: none; box-shadow: none; transform: none; }
.rcard.taken .art svg, .rcard.taken .txt { filter: grayscale(1); opacity: .42; }
.rcard.taken .art { background-color: #cfcbd8; }
.rcard.taken .art::before { opacity: .3; }
.rcard .owner.taken-by { right: auto; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-6deg); padding: 3px 14px; font-size: 15px; white-space: nowrap; box-shadow: 2px 3px 0 var(--ink); z-index: 2; animation: takenStamp .35s var(--ease) both; }
@keyframes takenStamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-6deg) scale(1.6); } }
@media (max-width: 700px) { .rcard .owner.taken-by, .ov-cards .rcard .owner.taken-by, .draft-cards .rcard .owner.taken-by { left: 50%; right: auto; top: 50%; font-size: 13px; padding: 2px 10px; } }


/* ================= 极简对局界面（参照 APK）：顶部一排玩家，点头像看详情；快捷聊天收进顶栏按钮 ================= */
#game #emotes {
  display: none; position: absolute; z-index: 60; top: 54px; right: 8px; width: min(288px, calc(100% - 16px)); box-sizing: border-box;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; transform-origin: 85% 0;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 5px 0 var(--ink); overflow: visible;
}
#game #emotes.open { display: grid; animation: tbPop .24s cubic-bezier(.2, 1.5, .35, 1) both; }
#game #emotes[hidden] { display: none; }
#game #emotes button { flex: none; min-width: 0; min-height: 44px; padding: 0 4px; font-size: 15px; border-radius: 12px; box-shadow: 0 2px 0 var(--ink); }
.prow .pav, .prow .hand i { cursor: pointer; }
.prow:hover { transform: translateY(-2px); }
.prow.open { background: #FFF6DA; box-shadow: 0 0 0 3px var(--c), 2px 4px 0 3px var(--ink); }
.prow:focus-visible { outline: 3px solid #4D9DF7; outline-offset: 3px; }
.prow .rk { position: absolute; left: -8px; top: -8px; z-index: 3; min-width: 20px; height: 20px; padding: 0 4px; box-sizing: border-box; border: 2px solid var(--ink); border-radius: 99px; background: #fff; color: var(--ink); font-style: normal; font-size: 11px; font-weight: 900; line-height: 16px; text-align: center; pointer-events: none; }
.prow .rk.rk1 { background: var(--gold); }
.prow .rk.rk2 { background: var(--silver); }
.prow .rk.rko { background: var(--ink3); color: #fff; }

.player-pop { position: fixed; z-index: 35; width: var(--w, 320px); box-sizing: border-box; padding: 12px; background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 5px 0 var(--ink); transform-origin: var(--ax, 50%) 0; --mh: 400px; }
.player-pop[hidden] { display: none; }
.player-pop.in { animation: tbPop .24s cubic-bezier(.2, 1.5, .35, 1) both; }
.player-pop::before { content: ""; position: absolute; top: -10px; left: calc(var(--ax, 50%) - 8px); width: 14px; height: 14px; background: var(--paper); border-left: 3px solid var(--ink); border-top: 3px solid var(--ink); rotate: 45deg; border-radius: 3px 0 0 0; }
.pp-head { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.pp-head .pav { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--c); box-shadow: 0 0 0 2px var(--ink); background: var(--paper); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pp-head .pav svg { width: 118%; height: 118%; }
.pp-head .pav .init { font-weight: 900; font-size: 18px; color: var(--c); }
.pp-who { min-width: 0; }
.pp-who > b { display: flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-who .you, .pp-who .auto { font-size: 10px; padding: 0 6px; border-radius: 99px; flex: none; font-weight: 900; }
.pp-who .you { background: var(--ink); color: #fff; }
.pp-who .auto { background: var(--line); color: var(--ink2); }
.pp-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.pp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 5px; border: 1.5px solid var(--ink); border-radius: 99px; background: var(--bg); font-size: 11.5px; font-weight: 900; }
.pp-chip i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--gold); }
.pp-chip.silver i { background: var(--silver); }
.pp-chip.bronze i { background: #C98A4B; }
.pp-none { font-size: 12px; font-weight: 700; color: var(--ink3); }
.pp-sc { display: flex; align-items: center; gap: 3px; }
.pp-sc .sk-star { display: block; width: 20px; height: 20px; }
.pp-sc .sk-star svg { display: block; width: 100%; height: 100%; }
.pp-sc b { font-size: 30px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.pp-sec { display: flex; align-items: baseline; gap: 6px; margin: 10px 0 6px; font-size: 12px; font-weight: 900; color: var(--ink2); }
.pp-sec small { font-size: 11px; font-weight: 800; }
.pp-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(var(--mh) - 112px); overflow-y: auto; padding: 2px 3px 3px 1px; margin: -2px -3px -3px -1px; }
.pp-r { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 5px 9px 5px 6px; border: 2px solid var(--ink); border-radius: 12px; background: var(--bg); cursor: help; }
.pp-r > i { width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 10px; background: var(--rc, var(--bg2)); overflow: hidden; display: block; box-sizing: border-box; }
.pp-r > i svg { width: 100%; height: 100%; display: block; }
.pp-r.now { background: #FFF3C4; box-shadow: 0 0 0 2.5px var(--yellow); }
.pp-r.used { opacity: .5; }
.pp-r.used > i { filter: grayscale(1); }
.pp-n { min-width: 0; }
.pp-n b { display: block; font-size: 14px; font-weight: 900; line-height: 1.2; }
.pp-n small { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-r em { font-style: normal; font-size: 12px; font-weight: 900; color: var(--ink2); white-space: nowrap; }
.pp-r em u { text-decoration: none; margin-right: 5px; padding: 0 6px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 10.5px; }
.pp-empty { padding: 6px 2px; }
@media (prefers-reduced-motion: reduce) { .player-pop.in, .prow:hover { animation: none; transform: none; } }


/* ================= 选秀：所有卡一屏摆完（fitDraft 选卡宽 --cw 与密度档 data-d），一代二代卡面统一 ================= */
#game .draft { gap: 8px; padding: 2px 4px 0; justify-content: flex-start; }
#game .draft-head { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 4px 14px; }
#game .draft-head h2 { font-size: 20px; }
#game .draft-head p { display: block; margin: 0; font-size: 12.5px; }
#game .draft .my-team { gap: 8px; padding: 5px 12px; }
#game .draft .mt-slot { width: 50px; height: 50px; }
#game #draftCards.draft-cards {
  display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: flex-start; align-items: stretch;
  gap: 10px; width: 100%; max-width: none; margin: 0; padding: 4px; flex: 1 1 0; min-height: 0; overflow: hidden;
}
#game #draftCards.fitted { align-content: center; }
#game #draftCards .rcard { --w: var(--cw, 168px); width: var(--w); flex: none; display: flex; flex-direction: column; }
#game #draftCards .rcard .art { display: flex; flex: none; height: calc(var(--w) * var(--ar, .5)); min-height: 0; border-right: 0; border-bottom: 2.5px solid var(--ink); align-items: flex-end; }
#game #draftCards .rcard .art svg { width: 82%; height: 96%; }
#game #draftCards .rcard .art .nm { display: block; font-size: 14px; }
#game #draftCards .rcard .nm2 { display: none; }
#game #draftCards .rcard .txt { flex: 1 1 auto; min-height: 0; padding: 7px 9px 9px; }
#game #draftCards .rcard .tx { font-size: 12.5px; line-height: 1.4; }
#game #draftCards .rcard .nt { display: block; font-size: 11px; line-height: 1.35; }
#game #draftCards .rcard .owner { top: 6px; right: 6px; }
#game #draftCards[data-d="b"] { gap: 8px; }
#game #draftCards[data-d="b"] .rcard .txt { padding: 6px 8px 7px; }
#game #draftCards[data-d="b"] .rcard .tx { font-size: 11.5px; line-height: 1.35; }
#game #draftCards[data-d="b"] .rcard .nt, #game #draftCards[data-d="c"] .rcard .nt, #game #draftCards[data-d="c"] .rcard .tx, #game #draftCards[data-d="d"] .rcard .nt, #game #draftCards[data-d="d"] .rcard .tx { display: none; }
#game #draftCards[data-d="b"] .rcard .art .nm { font-size: 13px; }
#game #draftCards[data-d="c"] { gap: 7px; --ar: .72; }
#game #draftCards[data-d="c"] .rcard, #game #draftCards[data-d="d"] .rcard { border-radius: 12px; }
#game #draftCards[data-d="c"] .rcard .art .nm, #game #draftCards[data-d="d"] .rcard .art .nm { left: 4px; top: 4px; padding: 0 6px; font-size: 11.5px; border-width: 1.5px; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#game #draftCards[data-d="c"] .rcard .txt, #game #draftCards[data-d="d"] .rcard .txt { padding: 4px 3px 5px; text-align: center; }
#game #draftCards[data-d="c"] .rcard .sk, #game #draftCards[data-d="d"] .rcard .sk { margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; padding: 1px 6px; }
#game #draftCards .rcard .owner.taken-by { font-size: 13px; padding: 2px 10px; }
#game #draftCards[data-d="c"] .rcard .owner.taken-by, #game #draftCards[data-d="d"] .rcard .owner.taken-by { font-size: 11px; padding: 1px 6px; }
#game #draftCards[data-d="d"] { gap: 5px; --ar: .5; }
#game #draftCards[data-d="d"] .rcard .art .nm { font-size: 10.5px; padding: 0 4px; }
#game #draftCards[data-d="d"] .rcard .txt { padding: 2px 2px 3px; }
#game #draftCards[data-d="d"] .rcard .sk { font-size: 10px; padding: 0 5px; }
/* 矮屏（手机横屏、矮竖屏）：收起选秀标题行，把高度都让给卡牌 */
@media (max-height: 560px), (max-width: 600px) and (max-height: 700px) { #game .draft-head { display: none; } #game .draft { gap: 5px; } }
@media (max-height: 560px) {
  #game .draft .my-team { gap: 6px; padding: 3px 10px; }
  #game .draft .mt-slot { height: 34px; }
}
#game #draftCards .rcard.armed { outline: 3px solid var(--yellow); outline-offset: 1px; transform: translateY(-3px); }
#game #draftCards[data-d="d"] .rcard.armed::after, #game #draftCards[data-d="c"] .rcard.armed::after { font-size: 10px; letter-spacing: -.5px; }
#game #draftCards .rcard.armed::after { content: "再点一次选 TA"; position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; background: var(--yellow); border-top: 2px solid var(--ink); font-size: 11px; font-weight: 900; text-align: center; }

/* 玩家条更紧凑：一行只放头像、名字、星分 */
@media (min-width: 1001px) {
  .players { padding: 8px 4px 8px; }
  .prow { padding: 4px 12px 4px 8px; }
  .prow .pav { width: 38px; height: 38px; }
  .prow .sc { display: flex; align-items: center; gap: 3px; }
  .prow .sc .sk-star { display: block; width: 16px; height: 16px; }
  .prow .sc .sk-star svg { display: block; width: 100%; height: 100%; }
  .prow .sc b { display: inline; font-size: 22px; }
  .prow .sc span { display: none; }
}
#game #draftCards .rcard .owner.taken-by { left: 50%; right: auto; top: 50%; transform: translate(-50%, -50%) rotate(-6deg); white-space: nowrap; }
#game #draftCards .rcard .owner.taken-by { z-index: 2; }

/* 手机横屏（矮）：玩家条竖排在棋盘左侧空白处，只留头像 + 分数，点头像看详情 */
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 550px) {
  #game .side { display: flex; position: absolute; left: calc(6px + env(safe-area-inset-left)); top: 54px; width: 58px; z-index: 6; gap: 0; }
  #game .players { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 3px; padding: 0; }
  #game .prow { display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex: none; width: 58px; min-width: 0; padding: 2px 4px 2px 2px; gap: 2px; border-radius: 15px; border-width: 2px; box-shadow: 0 2px 0 var(--ink); }
  #game .prow.cur { transform: none; box-shadow: 0 2px 0 var(--ink), 0 0 0 2px var(--yellow); }
  #game .prow .pav { width: 26px; height: 26px; border-width: 2px; box-shadow: 0 0 0 1.5px var(--ink); flex: none; }
  #game .prow .pn, #game .prow .sc span, #game .prow .think, #game .prow .soon-tag { display: none; }
  #game .prow .sc { display: flex; align-items: center; gap: 1px; }
  #game .prow .sc .sk-star { display: none; }
  #game .prow .sc b { display: inline; font-size: 15px; }
  #game .prow .rk { left: auto; right: -5px; top: -6px; }
  #game .prow.me::after { content: "你"; position: absolute; left: -3px; bottom: -4px; padding: 0 4px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 9px; font-weight: 900; line-height: 13px; font-style: normal; }
}
.player-pop.beside::before { display: none; }
@media (max-width: 760px) and (orientation: landscape) and (max-height: 550px) {
  .top-actions { gap: 3px; }
  .top-actions .icon-btn { min-width: 40px; padding: 0 5px; }
  .topbar > .icon-btn { min-width: 40px; width: 40px; height: 40px; padding: 0; justify-content: center; }
  .topbar { gap: 4px; }
  .races { gap: 3px; }
  .race-pill { padding: 3px 5px; }
}

/* 紧凑密度下「点我选人」会盖住角色名，改为只靠呼吸光边提示 */
#game #draftCards[data-d="c"] .rcard.tap-hint::after, #game #draftCards[data-d="d"] .rcard.tap-hint::after { display: none; }

/* 实物版图中央：黑底，白色大标题（英文主、中文辅） */
.center-track b.ct-en { font-size: calc(48 * var(--u)); letter-spacing: .02em; color: #fff; -webkit-text-stroke: 0; text-shadow: calc(2 * var(--u)) calc(3 * var(--u)) 0 var(--c, var(--green)); }
.center-track small.ct-cn { font-size: calc(15 * var(--u)); font-weight: 900; color: rgba(255, 255, 255, .85); letter-spacing: .3em; margin-top: calc(-4 * var(--u)); }
.center-track small { color: rgba(255, 255, 255, .75); }
.board.tall .center-track b.ct-en { font-size: calc(36 * var(--u)); }
/* 对局中：黑底上的英文标题只作淡淡的水印 */
.center.hud-race .center-track b.ct-en { font-size: calc(30 * var(--u)); color: #fff; opacity: .22; -webkit-text-stroke: 0; text-shadow: none; }
/* 道具格上有人站着时：原图块淡出，格子上沿换成一枚叠在棋子上方的小图块，大家始终看得懂这格的效果 */
#trackSvg .cell .sptile { transition: opacity .2s; }
#trackSvg .cell.occ .sptile { opacity: 0; }
.cbadge { position: absolute; width: calc(36 * var(--u)); height: calc(36 * var(--u)); margin: calc(-18 * var(--u)) 0 0 calc(-18 * var(--u)); z-index: 12; pointer-events: none; animation: pop .25s var(--ease); filter: drop-shadow(0 calc(1.5 * var(--u)) 0 rgba(0, 0, 0, .35)); }
.cbadge svg { width: 100%; height: 100%; overflow: visible; }

/* ---------- 手机选秀：固定图标网格 + 独立技能栏 ----------
   名单一次排定、位置永不变：被选走的图标原地变灰并标上是谁选的；点图标只是在下方技能栏查看，点「选 TA」才真正选人 */
.draft-detail { display: none; }
#game .draft.ig { gap: 7px; padding: 2px 2px 0; justify-content: flex-start; overflow: hidden; }
#game .draft.ig .draft-head, #game .draft.ig #draftPager { display: none; }
#game .draft.ig #draftCards {
  display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 4), minmax(0, 118px));
  gap: 7px; width: 100%; max-width: 560px; margin: 0; padding: 3px; flex: 1 1 0; min-height: 0; overflow: hidden; align-content: center;
}
#game .draft.ig #draftCards .rcard { --w: 100%; width: 100%; height: 100%; min-height: 0; display: block; border-radius: 12px; box-shadow: 2px 3px 0 var(--ink); }
#game .draft.ig #draftCards .rcard .art { position: absolute; inset: 0; height: auto; border-bottom: 0; display: block; }
#game .draft.ig #draftCards .rcard .art svg { position: absolute; left: 0; top: 2px; width: 100%; height: calc(100% - 22px); }
#game .draft.ig #draftCards .rcard .art .nm {
  display: block; left: 0; right: 0; top: auto; bottom: 0; padding: 0 2px; border: 0; border-top: 2px solid var(--ink); border-radius: 0;
  font-size: 12px; line-height: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#game .draft.ig #draftCards .rcard .txt { display: none; }
#game .draft.ig #draftCards .rcard.taken { pointer-events: auto; cursor: pointer; }
#game .draft.ig #draftCards .rcard.taken .art .nm { opacity: .55; }
#game .draft.ig #draftCards .rcard .owner.taken-by { left: 50%; top: 40%; padding: 1px 6px; font-size: 10.5px; line-height: 14px; border-width: 1.5px; }
#game .draft.ig #draftCards .rcard.pickable:hover, #game .draft.ig #draftCards .rcard.pickable:active { transform: none; box-shadow: 2px 3px 0 var(--ink); }
#game .draft.ig #draftCards .rcard.sel { z-index: 3; transform: scale(1.05); box-shadow: 0 0 0 3px var(--yellow), 0 0 0 5.5px var(--ink); }
#game .draft.ig #draftCards .rcard.sel.taken { box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--ink3); }
#game .draft.ig .draft-detail {
  flex: none; width: 100%; max-width: 560px; min-height: 104px; display: grid; grid-template-columns: 62px minmax(0, 1fr) 86px; gap: 9px; align-items: center;
  padding: 8px 9px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm);
}
#game .draft.ig .draft-detail[hidden] { display: none; }
#game .draft.ig .draft-detail.empty { display: flex; justify-content: center; text-align: center; color: var(--ink2); font-size: 13px; font-weight: 800; }
.dd-art { width: 62px; height: 62px; align-self: start; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--rc); overflow: hidden; }
.dd-art svg { display: block; width: 100%; height: 100%; }
.draft-detail.taken .dd-art svg, .draft-detail.taken .dd-tx { filter: grayscale(1); opacity: .5; }
.dd-name { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; }
.dd-name b { font-size: 16px; font-weight: 900; }
.dd-name .sk { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 900; }
.dd-tx p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.38; font-weight: 600; color: var(--ink); }
.dd-tx small { display: block; margin-top: 2px; font-size: 11px; line-height: 1.3; color: var(--ink2); }
.dd-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; padding: 4px 4px; border: 2.5px solid var(--ink); border-radius: 12px; background: #FFC53D; box-shadow: 0 3px 0 var(--ink); font-family: inherit; color: var(--ink); cursor: pointer; }
.dd-btn b { font-size: 16px; font-weight: 900; line-height: 1.15; }
.dd-btn small { font-size: 10.5px; font-weight: 800; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn:disabled { background: #E3DCF2; color: var(--ink2); box-shadow: none; cursor: default; }
.dd-btn.go { animation: ddGo 1.4s ease-in-out infinite; }
@keyframes ddGo { 50% { filter: brightness(1.1); box-shadow: 0 3px 0 var(--ink), 0 0 0 4px rgba(255, 197, 61, .55); } }
.dd-btn.go:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); animation: none; }
@media (prefers-reduced-motion: reduce) { .dd-btn.go { animation: none; } }
/* 横屏手机：左边图标网格，右边技能栏 */
@media (max-height: 520px) and (orientation: landscape) {
  #game .draft.ig { padding-left: 66px; display: grid; grid-template-columns: minmax(0, 1fr) 270px; grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 8px; row-gap: 5px; align-items: stretch; justify-items: stretch; }
  #game .draft.ig > #draftOrder { grid-column: 1 / -1; justify-self: center; }
  #game .draft.ig > #draftCards { grid-column: 1; grid-row: 2; max-width: none; }
  #game .draft.ig > .draft-detail { grid-column: 2; grid-row: 2; max-width: none; grid-template-columns: 50px minmax(0, 1fr); align-content: start; align-items: start; }
  #game .draft.ig > .draft-detail .dd-btn { grid-column: 1 / -1; flex-direction: row; gap: 8px; min-height: 40px; }
  #game .draft.ig > .draft-detail .dd-art { width: 50px; height: 50px; }
  #game .draft.ig > .my-team { grid-column: 1 / -1; justify-self: center; }
}

/* —— 仿 APK「招募参赛者」：86% 深色遮罩 + 标题 + 头像格 + 固定高度技能栏 + 底部固定「选 TA」；所有区块高度固定，换人时什么都不跳 —— */
#game .draft.ig { background: rgba(22, 18, 34, .88); border-radius: 18px; padding: 8px 8px 7px; gap: 6px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06); }
#game .draft.ig::before { content: "招募参赛者"; flex: none; display: block; text-align: center; font-size: 17px; font-weight: 900; letter-spacing: 3px; color: #fff; line-height: 24px; }
#game .draft.ig #draftOrder { padding: 0 4px; justify-content: center; }
#game .draft.ig #draftOrder .do { background: rgba(255, 255, 255, .08); }
#game .draft.ig #draftOrder .do.past { background: var(--c); }
#game .draft.ig #draftOrder .do.now { background: var(--c); }
#game .draft.ig #draftOrder .do.me:not(.now) { background: #fff; color: var(--ink); }
#game .draft.ig #draftOrder .do-cue { background: rgba(255, 255, 255, .14); color: #fff; }
#game .draft.ig #draftOrder .do-cue.soon { background: var(--yellow); color: var(--ink); }
#game .draft.ig #draftOrder .do-cue.mine { background: var(--red); color: #fff; }
#game .draft.ig #draftCards .rcard.sel { transform: none; box-shadow: 0 0 0 3px var(--yellow), 0 0 0 5px var(--ink); }
#game .draft.ig #draftCards .rcard.sel::after {
  content: "✓"; position: absolute; right: -4px; top: -5px; z-index: 4; width: 22px; height: 22px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: 14px; font-weight: 900; line-height: 1;
}
#game .draft.ig #draftCards .rcard.sel.taken::after { background: #fff; color: var(--ink3); }
#game .draft.ig #draftCards .rcard.taken { filter: grayscale(1) brightness(.75); }
#game .draft.ig .draft-detail { display: flex; flex-direction: column; align-items: stretch; align-content: stretch; gap: 7px; padding: 0; min-height: 0; background: none; border: 0; box-shadow: none; }
#game .draft.ig .draft-detail[hidden] { display: none; }
#game .draft.ig .draft-detail.empty { display: flex; justify-content: flex-start; text-align: left; font-size: inherit; color: inherit; }
.dd-info { flex: none; height: 126px; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 10px; background: rgba(255, 255, 255, .1); border: 1.5px solid rgba(255, 255, 255, .22); border-radius: 14px; overflow: hidden; }
.draft-detail.empty .dd-info { display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .7); font-size: 13px; font-weight: 800; }
.dd-info .dd-tx { height: 100%; overflow-y: auto; scrollbar-width: none; }
.dd-info .dd-tx::-webkit-scrollbar { display: none; }
.dd-info .dd-name b, .dd-info .dd-tx p { color: #fff; }
.dd-info .dd-tx small { color: rgba(255, 255, 255, .62); }
.dd-info .dd-name .sk { background: var(--yellow); color: var(--ink); }
.draft-detail.taken .dd-info { filter: none; }
.dd-btn { flex: none; width: 100%; height: 54px; }
.dd-btn:disabled { background: #8D86A8; color: rgba(255, 255, 255, .82); border-color: rgba(255, 255, 255, .25); box-shadow: none; }
#game .draft.ig .my-team { background: rgba(255, 255, 255, .1); border: 1.5px solid rgba(255, 255, 255, .22); box-shadow: none; color: #fff; }
#game .draft.ig .my-team .mt-slot:not(.filled) { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .35); color: rgba(255, 255, 255, .8); }
#game .draft.ig .my-team > :first-child { color: #fff; }
@media (max-height: 520px) and (orientation: landscape) {
  #game .draft.ig { padding: 6px 8px 6px 70px; }
  #game .draft.ig::before { display: none; }
  #game .draft.ig > .draft-detail { justify-content: flex-start; }
  .dd-info { height: auto; min-height: 0; flex: 1 1 0; grid-template-columns: 50px minmax(0, 1fr); }
}

/* 手机选秀时底部 dock 的「等待中」和技能栏下的按钮重复：dock 的文字与按钮让出，只留一条倒计时细线，空间还给头像网格 */
#game:has(.draft.ig:not([hidden])) #dock { min-height: 0; height: 6px; padding: 0; }
#game:has(.draft.ig:not([hidden])) #dock .prompt { position: relative; width: 100%; min-height: 0; height: 6px; padding: 0; border: 0; background: none; box-shadow: none; animation: none; }
#game:has(.draft.ig:not([hidden])) #dock .prompt > :not(.timer) { display: none; }
#game:has(.draft.ig:not([hidden])) #dock .prompt .timer { left: 0; right: auto; bottom: 0; height: 5px; border-radius: 0 3px 3px 0; }

/* 矮屏手机（竖屏）：收起标题，技能栏与按钮变矮，仍保持固定高度 */
@media (max-height: 800px) and (orientation: portrait) {
  #game .draft.ig::before { display: none; }
  .dd-info { height: 106px; padding: 7px 9px; grid-template-columns: 54px minmax(0, 1fr); }
  .dd-art { width: 54px; height: 54px; }
  .dd-tx p { font-size: 12px; line-height: 1.32; }
  .dd-btn { height: 46px; min-height: 0; }
  #game .draft.ig .mt-slot { width: 44px; height: 44px; }
}
@media (max-height: 700px) and (orientation: portrait) {
  #game .draft.ig #draftOrder { display: none; }
  .dd-info { height: 96px; }
  #game .draft.ig .mt-slot { width: 36px; height: 36px; }
  #game .draft.ig .my-team { padding: 3px 8px; }
}

/* 手机出战复用选秀的头像格/技能栏样式 */
#overlay .pickig #pickCards .rcard { --w: 100%; width: 100%; height: 100%; min-height: 0; display: block; border-radius: 12px; box-shadow: 2px 3px 0 var(--ink); }
#overlay .pickig #pickCards .rcard .art { position: absolute; inset: 0; height: auto; border-bottom: 0; display: block; }
#overlay .pickig #pickCards .rcard .art svg { position: absolute; left: 0; top: 2px; width: 100%; height: calc(100% - 22px); }
#overlay .pickig #pickCards .rcard .art .nm {
  display: block; left: 0; right: 0; top: auto; bottom: 0; padding: 0 2px; border: 0; border-top: 2px solid var(--ink); border-radius: 0;
  font-size: 12px; line-height: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#overlay .pickig #pickCards .rcard .txt { display: none; }
#overlay .pickig #pickCards .rcard.taken { pointer-events: auto; cursor: pointer; }
#overlay .pickig #pickCards .rcard.taken .art .nm { opacity: .55; }
#overlay .pickig #pickCards .rcard .owner.taken-by { left: 50%; top: 40%; padding: 1px 6px; font-size: 10.5px; line-height: 14px; border-width: 1.5px; }
#overlay .pickig #pickCards .rcard.pickable:hover, #overlay .pickig #pickCards .rcard.pickable:active { transform: none; box-shadow: 2px 3px 0 var(--ink); }
#overlay .pickig #pickCards .rcard.sel { z-index: 3; transform: scale(1.05); box-shadow: 0 0 0 3px var(--yellow), 0 0 0 5.5px var(--ink); }
#overlay .pickig #pickCards .rcard.sel.taken { box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--ink3); }
#overlay .pickig .draft-detail {
  flex: none; width: 100%; max-width: 560px; min-height: 104px; display: grid; grid-template-columns: 62px minmax(0, 1fr) 86px; gap: 9px; align-items: center;
  padding: 8px 9px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm);
}
#overlay .pickig .draft-detail[hidden] { display: none; }
#overlay .pickig .draft-detail.empty { display: flex; justify-content: center; text-align: center; color: var(--ink2); font-size: 13px; font-weight: 800; }
#overlay .pickig #pickCards .rcard.sel { transform: none; box-shadow: 0 0 0 3px var(--yellow), 0 0 0 5px var(--ink); }
#overlay .pickig #pickCards .rcard.sel::after {
  content: "✓"; position: absolute; right: -4px; top: -5px; z-index: 4; width: 22px; height: 22px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: 14px; font-weight: 900; line-height: 1;
}
#overlay .pickig #pickCards .rcard.sel.taken::after { background: #fff; color: var(--ink3); }
#overlay .pickig #pickCards .rcard.taken { filter: grayscale(1) brightness(.75); }
#overlay .pickig .draft-detail { display: flex; flex-direction: column; align-items: stretch; align-content: stretch; gap: 7px; padding: 0; min-height: 0; background: none; border: 0; box-shadow: none; }
#overlay .pickig .draft-detail[hidden] { display: none; }
#overlay .pickig .draft-detail.empty { display: flex; justify-content: flex-start; text-align: left; font-size: inherit; color: inherit; }
/* —— 手机出战：深色面板，和选秀同款 —— */
#overlay .ov-box.pickig { width: min(560px, 100%); padding: 14px 10px 10px; background: rgba(22, 18, 34, .94); color: #fff; border-radius: 18px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08), 0 8px 30px rgba(0, 0, 0, .5); gap: 8px; overflow: hidden; }
#overlay .pickig h2 { font-size: 19px; letter-spacing: 2px; color: #fff; }
#overlay .pickig .sub { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, .75); }
#overlay .pickig #pickCards.pg-cards { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-auto-rows: 138px; gap: 9px; width: 100%; max-width: none; margin: 0; padding: 4px; overflow: visible; flex: none; }
#overlay .pickig .draft-detail { flex: none; }
#overlay .pickig #pickCards .rcard.sel::after { right: 5px; top: 5px; }
#overlay .pickig #pickCards .rcard { color: var(--ink); }
#overlay .pickig .pick-status { margin-top: 2px; background: rgba(255, 255, 255, .16); }
@media (max-height: 700px) and (orientation: portrait) { #overlay .pickig #pickCards.pg-cards { grid-auto-rows: 104px; } }
@media (max-height: 600px) and (orientation: portrait) { #overlay .pickig #pickCards.pg-cards { grid-auto-rows: 78px; gap: 7px; } #overlay .ov-box.pickig { padding-top: 10px; gap: 6px; } }
@media (max-height: 520px) and (orientation: landscape) {
  #overlay .ov-box.pickig { display: grid; width: min(760px, 100%); grid-template-columns: minmax(0, 1fr) 260px; grid-template-rows: auto auto minmax(0, 1fr) auto; column-gap: 10px; padding: 8px 10px; }
  #overlay .pickig h2, #overlay .pickig .sub { grid-column: 1 / -1; }
  #overlay .pickig #pickCards.pg-cards { grid-column: 1; grid-row: 3; grid-template-columns: repeat(var(--lc, 4), minmax(0, 112px)); justify-content: center; grid-auto-rows: 156px; align-content: center; }
  #overlay .pickig .draft-detail { grid-column: 2; grid-row: 3; }
  #overlay .pickig .pg-detail { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
  #overlay .pickig .pg-detail .dd-info { height: auto; flex: 1 1 0; min-height: 52px; padding: 6px 8px; }
  #overlay .pickig .pg-detail > .dd-btn { height: 40px; }
  #overlay .pickig .pg-detail:has(.pg-extra) { display: grid; grid-template-columns: minmax(0, 1fr) 92px; grid-template-rows: minmax(0, 1fr) 40px; gap: 6px; }
  #overlay .pickig .pg-detail:has(.pg-extra) .dd-info { grid-column: 1 / -1; }
  #overlay .pickig .pg-extra .dd-btn { height: 40px; min-height: 0; }
  #overlay .pickig .pick-status { grid-column: 1 / -1; }
}

/* 手机选择类弹层：次要按钮、单张候选、选手登场 */
.dd-btn.alt { background: #B9A8E8; }
#overlay .pickig .pg-extra { display: flex; gap: 8px; }
#overlay .pickig .pg-extra .dd-btn { flex: 1 1 0; height: 44px; }
#overlay .pickig.one #pickCards .rcard { grid-column: 1 / -1; justify-self: center; width: 50%; }
/* 电脑端：人再多也同排一行，卡片宽度随人数与屏宽缩放 */
#overlay .ov-box.card .reveal-grid { --fw: clamp(104px, calc((min(100vw, 940px) - 120px) / var(--n, 4) - 14px), 150px); flex-wrap: nowrap; gap: 14px; }
#overlay .ov-box.card .reveal-grid .flip { width: var(--fw); height: calc(var(--fw) * .667 + 54px); }
#overlay .ov-box.card .reveal-grid .flip .rcard .tx { display: none; }
#overlay .ov-box.card .reveal-grid .flip .rcard { --w: var(--fw); }
#overlay .pickig.reveal .reveal-grid { margin: 10px auto 0; gap: 34px 12px; max-width: 348px; }
#overlay .pickig.reveal .flip { width: 104px; height: 124px; }
#overlay .pickig.reveal .flip .rcard { --w: 104px; }
#overlay .pickig.reveal .flip .rcard .txt { display: none; }
#overlay .pickig.reveal .flip .rcard .art { flex: 1 1 auto; height: auto; border-bottom: 0; }
@media (max-height: 520px) and (orientation: landscape) { #overlay .ov-box.pickig.reveal { display: flex; flex-direction: column; align-items: center; width: min(760px, 100%); } #overlay .pickig.reveal .reveal-grid { flex-wrap: nowrap; max-width: none; gap: 12px 8px; margin-top: 4px; } #overlay .pickig.reveal { --fw: min(100px, calc((100vw - 110px) / 6 - 8px)); } #overlay .pickig.reveal .flip { width: var(--fw); height: calc(var(--fw) * 1.12); } #overlay .pickig.reveal .flip .rcard { --w: var(--fw); } #overlay .pickig.reveal .flip .who { font-size: 10.5px; padding: 1px 6px; } }
#overlay .pickig.reveal .rcard .nm, #overlay .pickig.reveal .rcard .tx, #overlay .pickig.reveal .rcard .sk + * { color: var(--ink); }
#overlay .pickig.reveal .rcard .sk { color: #fff; }
#overlay .pickig.reveal .flip .who { left: 50%; right: auto; transform: translateX(-50%); white-space: nowrap; padding: 1px 8px; border-radius: 99px; background: #fff; font-size: 12px; font-weight: 900; }

/* 竖屏赛道是主角：底部行动面板压到最矮，名次差距那一行收起（名次在玩家栏里也看得到） */
.board.tall .tc-gap { display: none; }

/* 倒计时头像环：思考中的人，头像原来的边框换成一圈随时间收缩的圆环（顺时针消失） */
#players .prow[data-ring] .pav {
  border-width: 4px; border-color: transparent;
  background: linear-gradient(var(--paper), var(--paper)) padding-box,
    conic-gradient(from 0deg, var(--ring-c, #FFB703) calc(var(--ring, 1) * 1turn), rgba(35, 31, 51, .16) 0) border-box;
}
#players .prow[data-ring="urgent"] .pav { --ring-c: #FF4D3D; }
#players .prow.me[data-ring="urgent"] .pav { animation: ringUrgent .5s ease-in-out infinite alternate; }
@keyframes ringUrgent { to { scale: 1.07; } }

/* 不让系统/微信按自己的字号设置放大文字（一屏布局按固定字号排版） */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ================= 语音开麦（voice.js） ================= */
.topbar > .tb-mic { order: 2; }
.tb-mic .lbl { display: none; }
.voice-mic.on { background: var(--green); color: #fff; }
/* 房间里的开麦按钮挨着右上角的声音开关 */
.lobby-mic { position: absolute; top: 0; right: 52px; z-index: 2; height: 44px; min-width: 44px; justify-content: center; }
.lobby-mic .lbl { display: none; }
@media (min-aspect-ratio: 5/4) and (max-height: 560px) {
  .lobby-mic { position: static; grid-column: 1; grid-row: 1; justify-self: end; align-self: start; margin-right: 52px; }
}
/* 横屏手机顶栏放不下场次名：和竖屏一样只留序号，给开麦按钮腾位置 */
@media (max-width: 760px) and (orientation: landscape) {
  #game .race-pill .tn { display: none; }
}
.voice-mic.busy { opacity: .7; }
.voice-ear.off { color: var(--ink3); }
@media (max-width: 600px) and (orientation: portrait) {
  #game .topbar > .tb-mic { order: 4; }
}
/* 开着麦：头像外一圈绿；正在说话：绿圈外扩呼吸。用 outline，不和各布局里头像自己的 box-shadow 打架 */
.prow.mic-on .pav, .seat.mic-on .ava { outline: 2.5px solid var(--green); outline-offset: 2px; }
.prow.talking .pav, .seat.talking .ava { animation: voice-talk 0.9s ease-in-out infinite; }
@keyframes voice-talk {
  0%, 100% { outline-width: 2.5px; outline-offset: 2px; }
  50% { outline-width: 4px; outline-offset: 4px; }
}
/* 观众没有座位：说话的人名字浮在顶部 */
.voice-talk {
  position: fixed; z-index: 70; top: calc(env(safe-area-inset-top) + 64px); left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; max-width: calc(100vw - 32px); padding: 5px 12px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--green); color: #fff;
  font-weight: 800; font-size: 13px; box-shadow: var(--shadow-sm); pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.voice-talk svg { width: 16px; height: 16px; flex: none; }
@media (prefers-reduced-motion: reduce) {
  .prow.talking .pav, .seat.talking .ava { animation: none; outline-width: 4px; }
}
.voice-debug {
  position: fixed; z-index: 90; left: 6px; bottom: calc(env(safe-area-inset-bottom) + 6px); margin: 0; max-width: calc(100vw - 12px);
  padding: 6px 8px; border-radius: 8px; background: rgba(22, 18, 38, .86); color: #fff; font: 11px/1.45 ui-monospace, Menlo, monospace;
  white-space: pre-wrap; pointer-events: none;
}

/* 反馈问题弹框：对局里随时可开，盖在遮罩之上、提示之下 */
.report-box { position: fixed; z-index: 85; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 360px); padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 6px 0 var(--ink); }
.report-box[hidden] { display: none; }
.report-box p { margin: 0; font-size: 13px; opacity: .75; }
.report-box textarea { min-height: 84px; resize: vertical; font: inherit; padding: 8px; border: 2px solid var(--ink); border-radius: 10px; }
.rb-acts { display: flex; justify-content: flex-end; gap: 8px; }
.rb-acts button { font: inherit; font-weight: 800; padding: 6px 14px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); color: var(--ink); cursor: pointer; }
.rb-acts .primary { background: #FFD43B; }
.rec-report { display: block; margin: 12px auto 0; font: inherit; font-size: 13px; font-weight: 800; padding: 5px 14px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); color: var(--ink); cursor: pointer; }
/* 手机横屏顶栏按钮平铺、很挤：反馈入口改在赛事纪录弹窗里 */
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 550px) { #reportBtn { display: none; } }
