/* 对手面板（紧凑两行，和阶段提示同一行） */
.opp { position: relative; flex: 0 1 270px; min-width: 200px; display: flex; gap: 7px; align-items: center; padding: 4px 9px 4px 4px; border-radius: 11px; cursor: pointer;
  background: linear-gradient(180deg, rgba(40,43,49,.95), rgba(25,27,31,.95)); border: 1px solid var(--line); box-shadow: 0 4px 12px rgba(0,0,0,.45); transition: border-color .2s, transform .2s; }
.opp:hover { transform: translateY(-1px); border-color: var(--line2); }
.opp.cur { border-color: var(--pc); box-shadow: 0 0 0 1px var(--pc), 0 0 18px color-mix(in srgb, var(--pc) 35%, transparent); }
.opp.off { opacity: .6; }
.op-mech { width: 42px; height: 38px; object-fit: contain; filter: drop-shadow(0 3px 4px #000); flex: none; }
.opp.cur .op-mech { animation: mechbob 1.6s ease-in-out infinite; }
.op-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.op-top { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; line-height: 1.2; }
.op-n { color: var(--pc); font-family: var(--zh); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-turn { display: inline-flex; align-items: center; gap: 2px; }
.op-turn i { width: 3px; height: 3px; border-radius: 50%; background: var(--pc); animation: think 1.2s infinite; } .op-turn i:nth-child(2) { animation-delay: .2s; } .op-turn i:nth-child(3) { animation-delay: .4s; }
.op-fl { margin-left: auto; font-size: 11px; color: var(--dim); white-space: nowrap; }
.op-mid { display: flex; align-items: center; gap: 7px; font-size: 12px; min-width: 0; }
.op-fuel { display: inline-flex; align-items: center; gap: 4px; flex: 1 1 50px; min-width: 40px; }
.ofb { position: relative; flex: 1; height: 6px; border-radius: 4px; background: #0b0b0c; box-shadow: inset 0 0 0 1px #33302a; overflow: hidden; display: block; }
.ofb i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #d4620a, #ffb04a); border-radius: 4px; transition: width .4s; }
.ofb s { position: absolute; top: 0; bottom: 0; width: 2px; background: #888; }
.op-fuel .num { font-size: 13px; color: #ffcf7a; font-weight: 400; }
.op-st { display: inline-flex; align-items: center; gap: 1px; } .op-st .ic { width: 13px; height: 13px; } .op-st b { font-weight: 400; font-size: 13px; }
.op-gems { display: inline-flex; gap: 1px; align-items: center; } .op-gems .gem { width: 15px; height: 15px; }
.op-gems .eslot { width: 8px; height: 8px; border-radius: 2px; background: #000; box-shadow: inset 0 0 0 1px #3a3f47; margin: 0 1px; }
.op-dr { display: inline-flex; gap: 2px; } .op-dr i { width: 6px; height: 6px; border-radius: 50%; background: #333; } .op-dr i.on { background: #8fd3ff; box-shadow: 0 0 5px #8fd3ff; }
.op-prog { position: relative; height: 4px; border-radius: 3px; background: #0b0b0c; box-shadow: inset 0 0 0 1px #2e3238; margin-top: 1px; }
.op-prog i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #6a54b0, #a98aff); transition: width .4s; }
.op-prog s { position: absolute; top: -1px; bottom: -1px; width: 1px; background: #9a86d8; }
.op-prog b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--hazard); }
.bubble { position: absolute; left: 44px; top: -30px; z-index: 6; max-width: 240px; padding: 5px 10px; border-radius: 10px; background: #f2ead8; color: #222; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 10px rgba(0,0,0,.6); animation: toastin .25s ease-out; }
.bubble::after { content: ''; position: absolute; left: 14px; bottom: -6px; border: 6px solid transparent; border-top-color: #f2ead8; border-bottom: 0; }

/* 对话框 */
.modal { position: fixed; inset: 0; z-index: 800; display: flex; align-items: center; justify-content: center; background: rgba(5,5,6,.58); animation: mfade .16s ease-out; padding: 16px; }
.modal.out { animation: mfadeout .16s ease-in forwards; }
@keyframes mfade { from { opacity: 0; } } @keyframes mfadeout { to { opacity: 0; } }
.mbox { display: flex; gap: 16px; max-width: min(640px, 96vw); max-height: 90vh; overflow: auto; padding: 22px 24px 18px; border-color: rgba(246,194,28,.45); animation: mpop .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes mpop { from { transform: scale(.92); opacity: 0; } }
.m-art img { width: 120px; border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,.6); }
.m-body { flex: 1; min-width: 0; }
.mbox h2 { color: var(--hazard); font-size: 20px; font-weight: 400; margin: 0 0 8px; letter-spacing: .06em; }
.m-note { color: var(--dim); font-size: 13.5px; line-height: 1.6; margin-bottom: 10px; }
.m-opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 16px; min-width: 240px; border-radius: 11px; cursor: pointer; border: 1px solid var(--line2); background: var(--metal-hi); color: var(--txt); font-size: 17px; transition: all .15s; }
.opt .fxi .ic, .opt-l > .ic { width: 22px; height: 22px; }
.opt .fxi { font-family: var(--num); font-size: 20px; gap: 4px; }
.opt:hover:not(:disabled) { border-color: var(--hazard); transform: translateX(3px); background: linear-gradient(180deg, #3a3e45, #2a2d33); }
.opt.pri { border-color: #8a6a12; }
.opt:disabled { opacity: .45; cursor: not-allowed; }
.opt-ic { flex: none; } .opt-ic .ic { width: 24px; height: 24px; }
.opt-txt { display: flex; flex-direction: column; gap: 2px; }
.opt-l { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.opt-l .gem { width: 24px; height: 24px; }
.opt-s { font-size: 12px; color: var(--dim); }
.opt-why { font-size: 12px; color: var(--bad); }
.m-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* 选牌界面（杀戮尖塔式） */
.modal.picker { flex-direction: column; justify-content: flex-start; padding: 24px 20px 16px; background: radial-gradient(ellipse at 50% 45%, rgba(20,20,24,.86), rgba(5,5,6,.95)); gap: 16px; overflow: auto; }
.modal.picker > .pk-head { margin-top: auto; }
.modal.picker > .pk-foot { margin-bottom: auto; }
.pk-head { text-align: center; }
.pk-head h2 { color: var(--hazard); font-size: 26px; font-weight: 400; margin: 0; letter-spacing: .08em; text-shadow: 0 2px 0 #000; }
.pk-head .m-note { margin: 6px 0 0; }
.pk-body { width: min(1100px, 100%); display: flex; flex-direction: column; gap: 14px; }
.pk-group { display: flex; flex-direction: column; align-items: center; }
.pk-lbl { font-family: var(--zh); color: var(--hazard); font-size: 13px; letter-spacing: .12em; margin-bottom: 8px; padding: 1px 12px; border-radius: 99px; background: #0008; border: 1px solid var(--line); }
.pk-cards { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.pk-card { position: relative; width: var(--pkW, 160px); padding: 0; border: none; background: none; cursor: pointer; border-radius: 10px; transition: transform .16s cubic-bezier(.25,.8,.3,1); animation: pkin .3s ease-out both; }
.pk-card img { width: 100%; display: block; border-radius: 10px; box-shadow: 0 8px 18px rgba(0,0,0,.6); }
.pk-card:hover { transform: translateY(-8px) scale(1.04); }
.pk-card.sel { transform: translateY(-10px); }
.pk-card.sel img { box-shadow: 0 0 0 3px var(--hazard), 0 0 30px rgba(246,194,28,.55); }
.pk-card.dis { opacity: .45; cursor: not-allowed; }
.pk-tag { position: absolute; left: 6px; top: 6px; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: rgba(160,30,20,.92); color: #fff; }
.pk-chk { position: absolute; right: -8px; top: -8px; width: 30px; height: 30px; border-radius: 50%; background: var(--hazard); color: #1d1405; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0,0,0,.6); animation: pulseK .35s ease-out; }
.pk-chk .ic { width: 18px; height: 18px; }
@keyframes pkin { from { opacity: 0; transform: translateY(20px); } }
.pk-foot { position: sticky; bottom: 0; width: min(900px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: rgba(20,21,24,.96); border: 1px solid var(--line2); box-shadow: var(--shadow); flex-wrap: wrap; }
.pk-cost { font-size: 15px; } .pk-cost b { color: var(--hazard); font-family: var(--num); font-size: 19px; font-weight: 400; }
.pk-cost.bad b { color: var(--bad); }
.pk-btns { display: flex; gap: 8px; margin-left: auto; }

/* 对手详情 */
.modal.oppd .mbox { flex-direction: column; max-width: min(820px, 96vw); }
.od-head { display: flex; align-items: center; gap: 12px; }
.od-head img { width: 70px; filter: drop-shadow(0 4px 6px #000); }
.od-n { font-size: 20px; color: var(--pc); }
.rdash { position: relative; margin: 6px auto 0; }
.rdash > img { display: block; border-radius: 10px; }
.rd-mk { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #111; box-shadow: 0 1px 3px #000; }
.rd-cap { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.rd-gem { position: absolute; transform: translate(-50%, -50%); }
.rd-gem .gem { width: 100%; height: 100%; display: block; }
.rd-drone { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; }
.rd-tile { position: absolute; transform: translate(-50%, -50%); filter: drop-shadow(0 2px 2px #000); }
.rd-tile.can { cursor: pointer; filter: drop-shadow(0 0 4px #ffd34a) drop-shadow(0 0 2px #ffd34a); animation: rdglow 1.6s ease-in-out infinite; }
@keyframes rdglow { 50% { filter: drop-shadow(0 0 8px #ffd34a) drop-shadow(0 0 3px #fff6); } }
.od-zones { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.od-l { font-size: 12px; color: var(--dim); margin-bottom: 4px; }
.od-cards { display: flex; gap: 6px; } .od-cards img { width: 74px; border-radius: 6px; box-shadow: 0 3px 8px rgba(0,0,0,.6); cursor: zoom-in; }

/* 同屏交接 */
.handover { position: absolute; inset: 0; z-index: 700; display: none; align-items: center; justify-content: center; background: rgba(5,5,6,.86); backdrop-filter: blur(6px); }
.handover.on { display: flex; animation: mfade .3s; }
.ho-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 40px; text-align: center; border-color: var(--pc); }
.ho-card img { width: 160px; filter: drop-shadow(0 10px 18px #000); animation: mechbob 2.4s ease-in-out infinite; }
.ho-t { font-size: 28px; }
.ho-card .dim { line-height: 1.7; }

/* 终局计分 */
.modal.score { background: rgba(5,5,6,.85); }
.sc-box { width: min(900px, 96vw); max-height: 94vh; overflow: auto; padding: 24px 28px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; border-color: var(--hazard); }
.sc-title { font-size: 40px; color: var(--hazard); letter-spacing: .2em; text-shadow: 0 3px 0 #000, 0 0 30px rgba(246,194,28,.4); animation: mpop .5s cubic-bezier(.2,.9,.3,1.3); }
.sc-podium { display: flex; gap: 18px; justify-content: center; align-items: flex-end; margin: 14px 0 10px; flex-wrap: wrap; }
.sc-p { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 18px; border-radius: 14px; background: linear-gradient(180deg, #2a2d33, #1a1c20); border: 1px solid var(--line); min-width: 150px;
  animation: pkin .5s ease-out both; animation-delay: calc(var(--i) * .15s); }
.sc-p.win { border-color: var(--hazard); box-shadow: 0 0 30px rgba(246,194,28,.35); transform: translateY(-10px); }
.sc-p img { width: 96px; filter: drop-shadow(0 6px 10px #000); }
.sc-p .crown { position: absolute; top: -20px; } .sc-p .crown .ic { width: 38px; height: 38px; filter: drop-shadow(0 3px 4px #000); animation: mechbob 2s infinite; }
.sc-n { font-size: 17px; color: var(--pc); } .sc-mn { font-size: 12px; }
.sc-tot { font-size: 46px; color: var(--hazard); line-height: 1; }
.sc-rank { font-size: 12px; color: var(--dim); }
.sc-tab { border-collapse: collapse; width: 100%; font-size: 14px; }
.sc-tab th { font-weight: 400; color: var(--dim); padding: 6px; font-family: var(--zh); }
.sc-tab td { padding: 6px 10px; border-top: 1px solid var(--line); position: relative; }
.sc-tab td:first-child { color: var(--dim); white-space: nowrap; }
.sc-tab td:not(:first-child) { text-align: center; }
.sc-tab td b { font-weight: 400; font-size: 17px; position: relative; z-index: 1; }
.sc-tab td i { position: absolute; left: 8%; bottom: 4px; height: 4px; width: calc(84% * var(--w)); background: linear-gradient(90deg, #7a5cd0, #b393ff); border-radius: 2px; opacity: .6; animation: barin .9s ease-out both; animation-delay: calc(.6s + var(--d) * .1s); transform-origin: left; }
.sc-tab td.neg b { color: #ff8a7a; } .sc-tab td.neg i { background: #c0392b; }
@keyframes barin { from { transform: scaleX(0); } }
.sc-tab tr.sum td { border-top: 2px solid var(--hazard); } .sc-tab tr.sum b { color: var(--hazard); font-size: 22px; }
.sc-note { font-size: 12px; }

/* 撤销的“倒带”闪一下 */
.game.rewind::before { content: ''; position: absolute; inset: 0; z-index: 650; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(120,180,255,.18), transparent); animation: rew .5s ease-out; }
@keyframes rew { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* ───── 单人模式：企业机器人 ───── */
.bot-stars { color: #ffd34a; font-size: 11px; letter-spacing: -1px; white-space: nowrap; }
.bot-stars i { font-style: normal; color: #555; }
.opp.bot { border-style: solid; background: linear-gradient(180deg, rgba(44,40,48,.96), rgba(26,24,30,.96)); }
.opp.bot::after { content: 'BOT'; position: absolute; right: 6px; bottom: 3px; font-family: var(--num); font-size: 10px; color: rgba(255,255,255,.18); letter-spacing: .1em; }
.bot-deck { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.bot-deck .ic { width: 14px; height: 14px; }
.bot-deck b { font-weight: 400; font-size: 14px; }
.bot-deck.danger b { color: #ff7a6a; animation: lowfuel 1s ease-in-out infinite; }
.bot-gems em { font-style: normal; font-size: 11px; color: #ff9a7a; margin-left: 2px; }
.bot-score .ic { width: 14px; height: 14px; }
.botboard { position: relative; flex: none; width: 100%; max-width: 100%; aspect-ratio: 1400 / var(--h); container-type: inline-size; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 22px rgba(0,0,0,.6); }
.botboard > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.botboard { --u: calc(100cqw / 1400); }
.bb-g { position: absolute; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); width: calc(40 * var(--u)); height: calc(40 * var(--u)); transform: translate(-50%, -50%); }
.bb-g.pair { width: calc(34 * var(--u)); height: calc(34 * var(--u)); }
.bb-g.buf { width: calc(44 * var(--u)); height: calc(44 * var(--u)); }
.bb-g .gem { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.8)); }
.bb-col { position: absolute; left: calc(var(--x0) * var(--u)); width: calc((var(--x1) - var(--x0)) * var(--u)); top: calc(206 * var(--u)); height: calc(354 * var(--u));
  border: 3px solid rgba(255,214,90,.9); border-radius: calc(14 * var(--u)); box-shadow: 0 0 18px rgba(255,200,60,.55), inset 0 0 22px rgba(255,200,60,.25); pointer-events: none; }
.bb-row { position: absolute; left: calc(225 * var(--u)); right: calc(5 * var(--u)); top: calc(var(--y0) * var(--u)); height: calc((var(--y1) - var(--y0)) * var(--u));
  background: rgba(90,180,255,.16); border-top: 2px solid rgba(120,200,255,.6); border-bottom: 2px solid rgba(120,200,255,.6); pointer-events: none; }
.bb-cell { position: absolute; left: calc(var(--x0) * var(--u)); width: calc((var(--x1) - var(--x0)) * var(--u)); top: calc(var(--y0) * var(--u)); height: calc((var(--y1) - var(--y0)) * var(--u));
  border: 3px solid #fff; border-radius: calc(10 * var(--u)); box-shadow: 0 0 0 3px rgba(61,156,255,.9), 0 0 26px rgba(120,200,255,.9); animation: cellpulse 1s ease-in-out infinite; pointer-events: none; }
@keyframes cellpulse { 50% { box-shadow: 0 0 0 5px rgba(61,156,255,.6), 0 0 40px rgba(160,220,255,1); } }
.bot-help { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; line-height: 1.65; color: var(--dim); margin-top: 10px; }
.bot-help b { color: var(--hazard); font-family: var(--zh); font-weight: 400; }
.bot-tiles img { width: auto !important; height: 46px; }
.modal.oppd .od-cards .gem { width: 26px; height: 26px; }

/* 翻牌查表 */
.botflip { position: fixed; left: 50%; top: 46%; z-index: 3; display: flex; gap: 22px; align-items: center; padding: 18px 22px; border-radius: 18px; pointer-events: none;
  background: rgba(14,14,18,.94); border: 1px solid rgba(120,200,255,.55); box-shadow: 0 24px 60px rgba(0,0,0,.8), 0 0 40px rgba(61,156,255,.25); max-width: 96vw; }
.bf-card { flex: none; width: 150px; text-align: center; perspective: 900px; }
.bf-in { position: relative; width: 150px; aspect-ratio: 420 / 585; transform-style: preserve-3d; }
.bf-face, .bf-back { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 10px; backface-visibility: hidden; box-shadow: 0 10px 24px rgba(0,0,0,.7); }
.bf-back { background: url('../assets/cards/back_card.webp') center / cover; transform: rotateY(180deg); }
.bf-cap { margin-top: 8px; font-family: var(--zh); font-size: 15px; color: var(--txt); }
.bf-cap span { font-family: var(--body); font-size: 12px; color: #ffb36b; }
.bf-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bf-title { font-size: 20px; color: #8cc8ff; letter-spacing: .08em; }
.bf-res { font-size: 15px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bf-res b { color: var(--hazard); font-weight: 400; font-family: var(--num); font-size: 19px; }
.bf-res .ic { width: 18px; height: 18px; }
@media (max-width: 760px) { .botflip { flex-direction: column; top: 40%; padding: 12px; gap: 10px; } .bf-card, .bf-in { width: 96px; } .bf-title { font-size: 16px; } }

/* 终局：单人结果 */
.sc-p.bot .sc-mn { color: #ffd34a; }
.sc-tab td.na { color: var(--dim2); }
.sc-verdict { font-family: var(--zh); font-size: 18px; letter-spacing: .1em; margin-top: 4px; }
.sc-verdict.win { color: #8dff9f; } .sc-verdict.lose { color: #ff8a7a; }

/* 手机看牌（cardView） */
.modal.cview { flex-direction: column; background: rgba(5,5,6,.82); }
.cv-box { display: flex; flex-direction: column; align-items: center; gap: 10px; max-height: 100%; overflow: auto; animation: mpop .22s cubic-bezier(.2,.9,.3,1.2); }
.cv-box > img { width: min(300px, 78vw); max-height: 58vh; object-fit: contain; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.75); }
.cv-box.land > img { width: min(440px, 94vw); }
.cv-box .zinfo { background: rgba(16,17,19,.94); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; font-size: 14px; line-height: 1.6; width: min(340px, 92vw); }
.cv-why { color: #ff8a7a; font-size: 13px; width: min(340px, 92vw); }
.cv-foot { display: flex; gap: 10px; justify-content: center; }
.cv-foot .btn { min-width: 110px; min-height: 42px; }
.cv-foot .btn.ghost { background: rgba(30,32,36,.95); border: 1px solid var(--line2); }
