* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #24401c; color: #fffbe8; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
#stage { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; transform-origin: 0 0; }
#gl { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- HUD ---------- */
#hud { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
#hud button, #hud #joy { pointer-events: auto; }
#topbar { position: absolute; left: 8px; left: max(8px, env(safe-area-inset-left)); top: 6px; display: flex; gap: 4px; align-items: stretch; padding: 4px; background: rgba(90, 56, 24, .88); border: 2px solid #c8964a; border-radius: 10px; }
#sunbox { width: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f4e2b0; border-radius: 6px; color: #3a2a10; }
.sunico { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle, #fff6a0 30%, #ffd02a 60%, #ff9a1a 100%); box-shadow: 0 0 8px #ffd02a; }
#sun-n { font-size: 16px; line-height: 1.1; }
#cards { display: flex; gap: 4px; }
#cards .card { flex-shrink: 0; }
.card { position: relative; width: 56px; height: 70px; padding: 0; border: 2px solid #8a6a3a; border-radius: 6px; background: linear-gradient(#e8f4d0, #b8d898); overflow: hidden; color: #2a2010; }
.card img { position: absolute; left: 2px; top: 0; width: 48px; height: 48px; pointer-events: none; }
.card .cost { position: absolute; left: 0; right: 0; bottom: 0; font-size: 13px; line-height: 18px; background: #f4ecd0; text-align: center; }
.card .cd { position: absolute; left: 0; right: 0; top: 0; background: rgba(0, 0, 0, .5); pointer-events: none; }
.card.poor { filter: grayscale(.6) brightness(.75); }
.card.imit img { filter: grayscale(1) brightness(1.15); }
.card.imit::after { content: '模仿'; position: absolute; left: 2px; top: 2px; font-size: 10px; line-height: 1; padding: 1px 2px; border-radius: 3px; background: rgba(60, 60, 60, .8); color: #fff; pointer-events: none; }
.card.sel { border-color: #ffe24a; box-shadow: 0 0 0 2px #ffe24a, 0 0 10px #ffe24a; transform: translateY(2px); }
.card.belt { background: linear-gradient(#cfd8e0, #9aa6b0); }
.card .nm { position: absolute; left: 0; right: 0; top: 16px; font-size: 11px; text-align: center; }
.kb { position: absolute; right: 1px; top: 1px; font-size: 10px; line-height: 13px; padding: 0 3px; border-radius: 3px; background: #2a2010; color: #ffe24a; font-style: normal; font-weight: 700; pointer-events: none; }
#tools { display: flex; flex-direction: column; gap: 4px; }
#tools button { flex: 1; }
#glove { position: relative; width: 52px; border: 2px solid #8a6a3a; border-radius: 6px; background: #8a6a4a; font-size: 13px; font-weight: 700; }
#glove.sel { border-color: #8ad8ff; box-shadow: 0 0 0 2px #8ad8ff; }
#shovel { position: relative; width: 52px; border: 2px solid #8a6a3a; border-radius: 6px; background: #6a7a8a; font-size: 13px; font-weight: 700; }
#btn-ult { width: 52px; border: 2px solid #c88a1e; border-radius: 6px; background: #b8641a; color: #fff; font-size: 13px; font-weight: 700; }
body.touch-mode #btn-ult { width: 52px; height: 40px; flex: none; font-size: 12px; }
#shovel.sel { border-color: #ffe24a; box-shadow: 0 0 0 2px #ffe24a; }
#hud-tr { position: absolute; right: 8px; right: max(8px, env(safe-area-inset-right)); top: 8px; display: flex; gap: 8px; }
#hud-tr button { min-height: 40px; padding: 4px 10px; font-size: 14px; background: rgba(40, 60, 30, .85); border: 1px solid rgba(255, 230, 150, .55); border-radius: 8px; }
#wavebar { position: absolute; left: 8px; left: max(8px, env(safe-area-inset-left)); top: 90px; display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: rgba(40, 30, 16, .78); border-radius: 14px; font-size: 13px; }
#wave-track { position: relative; width: 150px; height: 10px; background: #3a2a14; border-radius: 5px; overflow: visible; }
#wave-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #7ad84a, #d8e84a); border-radius: 5px; }
#wave-flags { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; }
#wave-flags i { position: absolute; top: -9px; width: 10px; height: 10px; margin-left: -5px; background: #d82a2a; clip-path: polygon(0 0, 100% 30%, 0 60%); }
#avapanel { position: absolute; left: 8px; left: max(8px, env(safe-area-inset-left)); top: 120px; padding: 6px 10px; min-width: 180px; background: rgba(60, 30, 80, .82); border: 1px solid #c8a8ff; border-radius: 10px; font-size: 13px; line-height: 1.5; }
#avapanel b { color: #e8d8ff; font-size: 15px; }
.hpbar { width: 160px; height: 8px; margin: 3px 0; background: rgba(0, 0, 0, .5); border-radius: 4px; overflow: hidden; }
.hpbar i { display: block; height: 100%; width: 100%; background: #7ad84a; }
#ava-skill { display: block; color: #ffe8a0; }
#demo-tag { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); padding: 2px 10px; border-radius: 10px; background: rgba(0, 0, 0, .5); color: #9fe8a0; font-size: 12px; }
#cross { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 50%; box-shadow: 0 0 2px #000; }
#cross::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; background: #fff; border-radius: 50%; }
#pops { position: absolute; left: 50%; top: 32%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pop { font-size: 22px; font-weight: 900; color: #ffe24a; text-shadow: 0 2px 4px #000, 0 0 2px #000; white-space: nowrap; animation: rise 1.8s ease-out forwards; }
@keyframes rise { 0% { opacity: 0; transform: translateY(10px); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
#banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: 42px; font-weight: 900; color: #ff4a2a; text-shadow: 0 3px 0 #3a0a00, 0 6px 14px #000; white-space: nowrap; animation: ban 2s ease-out; }
@keyframes ban { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
#toast { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: min(620px, 56%); padding: 6px 14px; background: rgba(30, 40, 20, .88); border-radius: 10px; font-size: 14px; line-height: 1.5; text-align: center; }
#keys-hint { position: absolute; left: 8px; left: max(8px, env(safe-area-inset-left)); bottom: 10px; font-size: 12px; color: rgba(255, 255, 255, .75); text-shadow: 0 1px 2px #000; max-width: 24%; line-height: 1.5; }
.tbtn { position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000; background: transparent; border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .3); }
.tbtn:active, .tbtn.on { background: rgba(255, 255, 255, .25); }
#b-possess { right: 34px; bottom: 50px; width: 96px; height: 96px; font-size: 20px; background: rgba(120, 60, 180, .55); border-color: #e0c8ff; }
#b-possess.on { background: rgba(180, 90, 255, .85); }
#b-cast { right: 146px; bottom: 62px; width: 72px; height: 72px; font-size: 13px; background: rgba(200, 120, 30, .6); border-color: #ffe0a0; }
#touch { display: none; }
body.touch-mode #touch { display: block; }
#joy { position: absolute; left: 34px; bottom: 26px; width: 130px; height: 130px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .75); background: rgba(0, 0, 0, .12); touch-action: none; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255, 255, 255, .45); border: 2px solid #fff; pointer-events: none; }
#b-fire { right: 34px; bottom: 50px; width: 96px; height: 96px; font-size: 20px; border-width: 4px; }
#b-skill { right: 150px; bottom: 30px; width: 64px; height: 64px; font-size: 14px; }
#b-skill.cd { opacity: .45; }
#b-exit { right: 146px; bottom: 126px; width: 60px; height: 60px; font-size: 14px; }
#b-jump { right: 52px; bottom: 160px; width: 60px; height: 60px; font-size: 16px; }
/* 各模式下显示哪些控件 */
body:not(.m-ava):not(.m-nut) #joy, body:not(.m-ava) #b-fire, body:not(.m-ava) #b-skill, body:not(.m-ava) #b-jump, body:not(.m-ava):not(.m-nut) #b-exit { display: none; }
body.m-ava #b-possess, body.m-nut #b-possess, body.m-ava #b-cast, body.m-nut #b-cast { display: none; }
body.m-nut #joy { width: 150px; height: 90px; border-radius: 45px; }
body.touch-mode .kb, body.touch-mode #keys-hint { display: none; }
body.touch-mode .card { width: 50px; height: 62px; }
body.touch-mode .card img { width: 44px; height: 44px; left: 1px; }
body.touch-mode #sunbox { width: 54px; }
body.touch-mode #shovel, body.touch-mode #glove { width: 46px; font-size: 12px; }
body.touch-mode #topbar, body.touch-mode #cards { gap: 8px; }
body.touch-mode #wavebar { top: 84px; }
/* 玩家留言「手机横屏点铲子手套容易点到菜单」（实测 9 张卡时切换视角键整个盖住铲子）：触屏把铲子手套竖着放到左边 */
body.touch-mode #tools { position: absolute; left: 0; top: 112px; width: 52px; }
body.touch-mode #tools button { width: 52px; height: 40px; flex: none; }
body.touch-mode.m-ava #tools, body.touch-mode.m-nut #tools { display: none; }
/* OPPO 等机型反馈按键不画：HUD 单独成一个合成层，压在 3D 画布上面 */
#hud { z-index: 5; transform: translateZ(0); }
/* 面板要压在 HUD 合成层上面：否则暂停菜单、放僵尸面板被卡槽和触屏按键盖住（玩家截图） */
.overlay { z-index: 6; }
body.touch-mode #avapanel { top: 114px; font-size: 12px; }
body.touch-mode #toast { bottom: 12px; font-size: 13px; max-width: 52%; }
body.touch-mode.m-ava #toast, body.touch-mode.m-nut #toast { bottom: auto; top: 114px; }
body.touch-mode #banner { font-size: 32px; }
body.touch-mode #hud-tr button { min-height: 38px; padding: 4px 8px; font-size: 13px; }

/* ---------- 菜单与面板 ---------- */
.overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: flex-start; justify-content: center; padding: 12px; overflow-y: auto; }
#menu { background: linear-gradient(90deg, rgba(20, 40, 14, .9) 0%, rgba(20, 40, 14, .5) 55%, rgba(20, 40, 14, .05)); justify-content: flex-start; padding-left: max(5vw, 16px); }
.overlay.dim { background: rgba(8, 16, 6, .66); }
.menu-box { width: min(400px, 94%); margin: auto 0; }
#panel .menu-box { width: min(560px, 96%); margin: auto; padding: 16px 18px; background: rgba(30, 50, 24, .97); border: 2px solid #c8964a; border-radius: 12px; text-align: center; }
h1 { font-size: 44px; line-height: 1.1; margin: 4px 0 4px; color: #d8ff7a; letter-spacing: 3px; text-shadow: 0 3px 0 #2a5a1a, 0 6px 14px #000; }
h1 small { display: block; font-size: 20px; letter-spacing: 6px; color: #ffd86a; text-shadow: 0 2px 0 #6a3a10, 0 4px 8px #000; }
h2 { font-size: 24px; margin-bottom: 8px; color: #ffe24a; }
.sub { color: #fff2b8; font-size: 16px; font-weight: 700; }
.best { margin: 6px 0 8px; color: #cfe6c0; font-size: 14px; min-height: 18px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; justify-content: center; }
.btns.col { flex-direction: column; align-items: stretch; }
.row2 { display: flex; gap: 8px; }
.row2 button { flex: 1; }
.btns button { min-width: 100px; min-height: 44px; padding: 8px 16px; font-size: 16px; background: rgba(40, 60, 30, .92); border: 1px solid #a88a4a; border-radius: 8px; }
.btns button small { display: block; font-size: 12px; font-weight: 400; opacity: .85; margin-top: 2px; }
.btns button.primary { background: linear-gradient(#5aa83a, #2e6e1e); border-color: #c8f08a; font-weight: 800; font-size: 18px; }
.btns button.primary.endless { background: linear-gradient(#a8562c, #6e2e14); border-color: #ffc08a; }
.btns button:disabled { opacity: .45; cursor: default; }
.btns button:hover:not(:disabled), .btns button:focus-visible { border-color: #ffe24a; outline: none; box-shadow: 0 0 0 2px rgba(255, 226, 74, .45); }
.menu-promo { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.fd-promo-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 14px; border-radius: 18px; border: 0; font-size: 14px; font-weight: 700; text-decoration: none; }
.fd-follow { background: #fb7299; color: #fff; }
.fd-share { background: #00aeec; color: #fff; }
.fd-more { background: #f0a020; color: #fff; }
.foot { margin-top: 10px; font-size: 12px; color: #a8c098; }
.hint { margin-top: 6px; font-size: 13px; color: #c8dcb8; line-height: 1.5; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 15px; text-align: left; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.seg button { padding: 6px 12px; min-height: 36px; border: 1px solid #a88a4a; border-radius: 6px; background: rgba(40, 60, 30, .92); font-size: 14px; }
.seg button.on { background: #4a9a2a; border-color: #c8f08a; }
.set input[type=range] { width: 150px; }
.help { text-align: left; font-size: 14px; line-height: 1.6; }
.help h3 { margin: 10px 0 2px; color: #ffe24a; font-size: 16px; }
.lvgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 8px 0; }
.lvgrid button { min-height: 62px; padding: 4px; border-radius: 8px; border: 2px solid #a88a4a; background: rgba(60, 90, 40, .95); font-size: 18px; font-weight: 800; }
.lvgrid button small { display: block; font-size: 11px; font-weight: 400; color: #ffe24a; letter-spacing: 1px; }
.lvgrid button:disabled { opacity: .4; cursor: default; }
.lvgrid button.cur { border-color: #ffe24a; }
.lvgrid button.ch2 { background: rgba(110, 60, 70, .95); border-color: #d89a6a; }
.chap { margin: 10px 0 2px; font-size: 16px; color: #ffd86a; text-align: left; }
.chap small { margin-left: 8px; font-size: 12px; font-weight: 400; color: #c8b8a0; }
.pickgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0; }
.pickgrid button { position: relative; padding: 2px 2px 4px; border-radius: 8px; border: 2px solid #8a6a3a; background: linear-gradient(#e8f4d0, #b8d898); color: #2a2010; font-size: 12px; line-height: 1.2; }
.pickgrid button img { display: block; width: 56px; height: 56px; margin: 0 auto; pointer-events: none; }
.pickgrid button small { display: block; font-size: 11px; color: #6a4a10; }
.pickgrid button:not(.on) { filter: grayscale(.7) brightness(.7); }
.pickgrid button.on { border-color: #ffe24a; box-shadow: 0 0 0 2px #ffe24a; }
.stars { font-size: 30px; color: #ffe24a; letter-spacing: 4px; text-shadow: 0 2px 4px #000; }
.stars i { color: #5a5a40; font-style: normal; }
.conds { list-style: none; font-size: 14px; line-height: 1.8; }
.conds .ok { color: #b8f08a; }
.conds .no { color: #a8a890; }
.big { font-size: 26px; font-weight: 900; color: #ffe24a; margin: 4px 0; }
.reward { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0; font-size: 17px; font-weight: 700; color: #d8ff7a; }
.reward img { width: 64px; height: 64px; }

#loading { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #24401c; z-index: 7; }
.ld-title { font-size: 40px; font-weight: 900; color: #d8ff7a; letter-spacing: 4px; }
#ld-text { color: #cfe6c0; }
#ld-retry { padding: 8px 18px; border-radius: 6px; border: 1px solid #ffe24a; background: #2e5a2a; }
@media (max-height: 430px) {
  h1 { font-size: 32px; } h1 small { font-size: 16px; }
  .sub { font-size: 14px; } .btns { gap: 6px; margin-top: 6px; } .btns button { min-height: 40px; padding: 6px 12px; font-size: 15px; }
  .btns button.primary { font-size: 16px; } .menu-promo { margin-top: 8px; } .foot { display: none; }
}

/* ---------- 0.3.0：Boss 血条、试验田工具、联机消息、更多卡片 ---------- */
#bossbar { position: absolute; left: 50%; top: 86px; transform: translateX(-50%); width: min(320px, 40%); padding: 3px 8px 5px; background: rgba(40, 10, 10, .8); border: 1px solid #ff8a5a; border-radius: 8px; text-align: center; font-size: 13px; pointer-events: none; }
#bossbar b { color: #ffd0a0; }
#boss-track { height: 9px; margin-top: 3px; background: rgba(0, 0, 0, .55); border-radius: 5px; overflow: hidden; }
#boss-fill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff3a2a, #ffb02a); }
#boss-tough { position: relative; height: 13px; margin-top: 3px; background: rgba(0, 0, 0, .55); border-radius: 5px; overflow: hidden; }
#boss-tough i { display: block; height: 100%; width: 100%; background: #c8c8d0; }
#boss-tough.el-fire i { background: #ff6a2a; }
#boss-tough.el-ice i { background: #4ab8f0; }
#boss-tough.el-boom i { background: #d8483a; }
#boss-tough.el-phys i { background: #6ab84a; }
#boss-tough.broken i { background: #ffe24a; }
#boss-tough span { position: absolute; left: 0; right: 0; top: 0; font-size: 10px; line-height: 13px; color: #fff; text-shadow: 0 1px 1px #000; }
#sbbar { position: absolute; right: 8px; right: max(8px, env(safe-area-inset-right)); top: 54px; display: none; gap: 10px; }
body.m-sandbox #sbbar { display: flex; }
#sbbar button, #btn-quick { min-height: 34px; padding: 4px 10px; font-size: 13px; background: rgba(60, 40, 90, .88); border: 1px solid #c8a8ff; border-radius: 8px; pointer-events: auto; }
#btn-quick { position: absolute; right: 8px; right: max(8px, env(safe-area-inset-right)); top: 54px; display: none; }
body.m-coop #btn-quick { display: block; }
body.m-sandbox #btn-quick { top: 98px; }
#quickpanel { position: absolute; right: 8px; right: max(8px, env(safe-area-inset-right)); top: 94px; display: flex; flex-direction: column; gap: 4px; pointer-events: auto; }
#quickpanel button { padding: 6px 12px; font-size: 14px; background: rgba(30, 40, 30, .92); border: 1px solid #a8c88a; border-radius: 6px; }
#quickpanel .chatrow { display: flex; gap: 4px; }
#chatin { width: 180px; min-height: 32px; padding: 4px 8px; font-size: 14px; color: #fff; background: rgba(20, 24, 20, .92); border: 1px solid #a8c88a; border-radius: 6px; -webkit-user-select: text; user-select: text; }
#chatmute { font-size: 12px !important; }
#chatlog { position: absolute; right: 8px; top: 94px; max-width: 42%; display: none; flex-direction: column; align-items: flex-end; gap: 3px; pointer-events: none; }
body.m-coop #chatlog { display: flex; }
body.m-sandbox #chatlog { top: 138px; }
#quickpanel:not([hidden]) ~ #chatlog { display: none; }
#chatlog .chatline { padding: 3px 8px; font-size: 14px; line-height: 1.35; color: #fff; background: rgba(0, 0, 0, .55); border-radius: 6px; text-shadow: 0 1px 2px #000; word-break: break-all; }
#chatlog .chatline b { color: #ffe08a; font-weight: normal; }
.card.zcard { background: linear-gradient(#e0d0f0, #a890c8); }
#cards.many .card { width: 50px; }
#cards.many .card img { width: 44px; height: 44px; left: 1px; }
body.touch-mode #cards.many { gap: 5px; }
body.touch-mode #cards.many .card { width: 44px; height: 58px; }
body.touch-mode #cards.many .card img { width: 40px; height: 40px; left: 0; }
#sunbox.brain .sunico { background: radial-gradient(circle, #ffd0d8 30%, #f08aa0 70%, #c05070 100%); box-shadow: 0 0 8px #f08aa0; }
.lvgrid button { position: relative; }
.lvgrid button em { position: absolute; right: 2px; top: 2px; font-size: 9px; font-style: normal; color: #fff; background: #c82a2a; border-radius: 3px; padding: 0 3px; }
.lvgrid button.ch3 { background: rgba(40, 80, 120, .95); border-color: #8ac8f0; }
.lvgrid button.ch4 { background: rgba(70, 80, 100, .95); border-color: #b8c0d0; }
.lvgrid button.ch5 { background: rgba(110, 60, 40, .95); border-color: #e0a070; }
.lvgrid button.iz { background: rgba(90, 60, 120, .95); border-color: #c8a8ff; }
.lvgrid button.ch2 { background: rgba(40, 40, 90, .95); border-color: #9a9ae0; }
.zgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.zgrid button { min-height: 40px; padding: 4px; border-radius: 6px; border: 1px solid #a88a4a; background: rgba(60, 70, 50, .95); font-size: 13px; }
.zgrid button.boss { background: rgba(110, 30, 30, .95); border-color: #ff8a5a; }
.roomlist { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.roomlist button { min-height: 40px; padding: 6px 10px; border-radius: 8px; border: 1px solid #a88a4a; background: rgba(40, 60, 30, .92); text-align: left; font-size: 14px; }
.set input[type=tel] { width: 110px; padding: 6px 8px; border-radius: 6px; border: 1px solid #a88a4a; background: #1e2e18; color: #fffbe8; font: inherit; }
.btns button.primary.fun { background: linear-gradient(#8a4ab8, #5a2a80); border-color: #e0c0ff; }
.btns button.primary.coop { background: linear-gradient(#2a8ab8, #1a5a80); border-color: #a8e0ff; }
.pickgrid { grid-template-columns: repeat(8, 1fr); }
.pickgrid button img { width: 48px; height: 48px; }
@media (max-width: 700px) { .pickgrid { grid-template-columns: repeat(6, 1fr); } }

/* ---------- 卡片描边：只按档位上边框色，不加文字角标，不加尺寸，手机小卡不挡阳光数字 ---------- */
.card.t2 { border-color: #4a9ae0; background: linear-gradient(#dceeff, #a8ccf0); }
.card.t3 { border-color: #b062e8; background: linear-gradient(#f4e0ff, #c896ee); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6), 0 0 6px rgba(176, 98, 232, .8); }
.card.belt.t2, .card.belt.t3 { background: linear-gradient(#cfd8e0, #9aa6b0); }
/* 选中态永远压过描边色，别让玩家看不出选了哪张 */
.card.t2.sel, .card.t3.sel { border-color: #ffe24a; box-shadow: 0 0 0 2px #ffe24a, 0 0 10px #ffe24a; }
.pickgrid button.t2 { border-color: #4a9ae0; background: linear-gradient(#dceeff, #a8ccf0); }
.pickgrid button.t3 { border-color: #b062e8; background: linear-gradient(#f4e0ff, #c896ee); }
.pickgrid button.on.t2, .pickgrid button.on.t3 { border-color: #ffe24a; box-shadow: 0 0 0 2px #ffe24a; }
/* 联机：房主审批队友附身 */
#coopask { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; padding: 6px 10px; background: rgba(30, 40, 20, .94); border: 1px solid #a8c88a; border-radius: 10px; font-size: 14px; white-space: nowrap; pointer-events: auto; }
#coopask[hidden] { display: none; }
#coopask span { margin-right: 8px; }
#coopask button { min-width: 56px; min-height: 36px; margin-left: 6px; padding: 4px 10px; font-size: 14px; color: #fff; background: rgba(80, 110, 60, .95); border: 1px solid #a8c88a; border-radius: 6px; }
#coopask #coopask-no { background: rgba(110, 60, 50, .95); }
/* 卡槽放不下时按可用宽度缩小，仍放不下就排两行 */
#cards.fit { gap: 4px !important; }
#cards.fit .card { width: var(--cw) !important; height: calc(var(--cw) + 16px) !important; }
#cards.fit .card .cost { font-size: 11px; letter-spacing: -0.5px; white-space: nowrap; line-height: 16px; }
#cards.fit .card img { width: calc(var(--cw) - 4px) !important; height: calc(var(--cw) - 4px) !important; left: 0 !important; }
#cards.fit2 { flex-wrap: wrap; }
#cards.fit2 .card { height: calc(var(--cw) + 14px) !important; }
