/* 游戏桌面布局（电脑 / 平板横屏） */
.game { position: relative; height: 100%; display: grid; grid-template-columns: var(--boardW, 300px) 1fr; grid-template-rows: 46px 1fr; overflow: hidden; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: linear-gradient(180deg, #1d1f23, #141518);
  border-bottom: 1px solid #000; box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 6px 14px rgba(0,0,0,.4); z-index: 30; min-width: 0; }
.minecol { grid-row: 2; position: relative; overflow: hidden; background: #0b0b0c; border-right: 1px solid #000; box-shadow: 4px 0 18px rgba(0,0,0,.5); z-index: 5; }
.center { grid-row: 2; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 8px 10px 0; gap: 8px; }

/* 顶栏 */
.tb-logo { width: 92px; height: 40px; background: url('../img/logo_zh.webp') left center / contain no-repeat; flex: none; filter: drop-shadow(0 2px 3px #000); }
.tb-round { font-family: var(--zh); font-size: 15px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tb-round b { font-family: var(--num); font-size: 22px; color: var(--hazard); font-weight: 400; }
.tb-final { color: #fff; background: linear-gradient(180deg, #d63d2c, #8e1e14); border-radius: 6px; padding: 1px 8px; font-family: var(--zh); font-size: 13px; animation: finalpulse 1.6s ease-in-out infinite; }
@keyframes finalpulse { 50% { box-shadow: 0 0 14px rgba(255,80,60,.7); } }
.phases { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.ph { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px 0 12px; font-family: var(--zh); font-size: 13px; color: var(--dim2);
  background: #0006; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); white-space: nowrap; transition: all .3s; }
.ph:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); }
.ph i { font-style: normal; font-family: var(--num); font-size: 14px; }
.ph.done { color: var(--dim); background: #2a2d33; }
.ph.on { color: #1d1405; background: linear-gradient(180deg, #ffd65a, #e0a312); box-shadow: 0 0 16px rgba(246,194,28,.35); }
.tb-cur { display: flex; align-items: center; gap: 8px; font-family: var(--zh); font-size: 14px; white-space: nowrap; min-width: 0; padding: 3px 12px 3px 4px; border-radius: 99px; background: #0005; border: 1px solid var(--line); }
.tb-cur img { width: 34px; height: 30px; object-fit: contain; }
.tb-cur.mine { border-color: var(--pc); box-shadow: 0 0 12px color-mix(in srgb, var(--pc) 45%, transparent); }
.tb-cur .think { display: inline-flex; gap: 3px; } .tb-cur .think i { width: 4px; height: 4px; border-radius: 50%; background: var(--dim); animation: think 1.2s infinite; }
.tb-cur .think i:nth-child(2) { animation-delay: .2s; } .tb-cur .think i:nth-child(3) { animation-delay: .4s; }
@keyframes think { 40% { transform: translateY(-4px); background: var(--txt); } }
.tb-spacer { flex: 1; }
.tb-dmg { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 13px; white-space: nowrap; }
.tb-dmg b { font-family: var(--num); font-size: 18px; color: #ff8b80; font-weight: 400; }
.tb-btns { display: flex; gap: 6px; }
.tb-btns .btn { height: 32px; }

/* 中间各区 */
.shopbar { flex: none; display: flex; gap: 8px; align-items: stretch; min-height: 0; }
.srow { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.opps-slot { display: contents; }
.opps { flex: 0 1 auto; display: flex; gap: 8px; min-width: 0; }
.srow .guide { flex: 1; min-width: 240px; }
.stage { flex: 1; min-height: 120px; position: relative; display: flex; flex-direction: column; gap: 8px; }
.dash { flex: none; display: flex; gap: 8px; align-items: stretch; }
.bottom { flex: none; height: var(--bottomH, 214px); display: flex; align-items: flex-end; gap: 8px; position: relative; z-index: 45; padding-bottom: 8px; }

/* 舞台：出牌区 + 能力 + 提示 */
.stage-top { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.guide { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 10px; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.15));
  border-left: 3px solid var(--pc); font-size: 14px; line-height: 1.5; min-height: 40px; }
.guide b { color: var(--hazard); font-family: var(--zh); font-weight: 400; letter-spacing: .04em; }
.guide .g-ph { font-family: var(--zh); color: var(--pc); white-space: nowrap; font-size: 15px; }
.guide .g-txt { color: var(--dim); }
.guide .g-txt em { font-style: normal; color: var(--txt); }
.guide .btn { margin-left: auto; }
.stage-mid { flex: 1; min-height: 0; display: flex; gap: 8px; align-items: stretch; }
.surf-slot { flex: none; display: flex; align-items: center; justify-content: center; min-width: 0; }
.game:not(.split) .surf-slot { display: none; }
.stage-right { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.played-wrap { position: relative; flex: 1; min-width: 0; min-height: 0; border-radius: 14px; border: 2px dashed rgba(255,255,255,.06); transition: border-color .2s, background .2s; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 120%, rgba(246,194,28,.06), transparent 60%), repeating-linear-gradient(-45deg, rgba(255,255,255,.012) 0 14px, transparent 14px 28px), rgba(0,0,0,.22);
  box-shadow: inset 0 2px 18px rgba(0,0,0,.55); }
.played-wrap::before { content: '出牌区'; position: absolute; left: 12px; top: 8px; font-family: var(--zh); font-size: 12px; letter-spacing: .2em; color: rgba(255,255,255,.16); pointer-events: none; }
.played-wrap.drop-hot { border-color: rgba(246,194,28,.75); background: radial-gradient(ellipse at center, rgba(246,194,28,.12), transparent 70%); }
.played-wrap.drop-bad { border-color: rgba(255,93,77,.7); background: radial-gradient(ellipse at center, rgba(255,93,77,.1), transparent 70%); }
.played-lbl { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font-family: var(--zh); font-size: 22px; letter-spacing: .2em; color: rgba(246,194,28,.85);
  pointer-events: none; opacity: 0; transition: opacity .2s; text-shadow: 0 2px 8px #000; white-space: nowrap; }
.played-wrap.drop-hot .played-lbl, .played-wrap.drop-bad .played-lbl { opacity: 1; }
.played-wrap.drop-bad .played-lbl { color: #ff8b80; }
.played { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 22px 10px 10px; min-height: 0; flex: 1; flex-wrap: nowrap; overflow: hidden; }
.pcard { position: relative; width: var(--pcW, 84px); flex: none; }
.pcard img { width: 100%; display: block; border-radius: 6px; box-shadow: 0 4px 10px rgba(0,0,0,.55); }
.pcard .stamp { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%) rotate(-6deg); font-family: var(--zh); font-size: 11px; padding: 1px 7px; border-radius: 5px;
  background: rgba(20,20,20,.88); border: 1px solid var(--line2); white-space: nowrap; display: flex; align-items: center; gap: 2px; }
.pcard .stamp.burn { color: #ffb36b; border-color: #8a4a12; } .pcard .stamp.main { color: #ffe08a; border-color: #8a6a12; }
.pcard .stamp .ic { width: 13px; height: 13px; }
.played-empty { color: var(--dim2); font-size: 13px; padding: 10px; align-self: center; margin: auto; text-align: center; line-height: 1.7; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acts-lbl { font-size: 12px; color: var(--dim); font-family: var(--zh); margin-right: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 9px; font-size: 13px; cursor: pointer; border: 1px solid var(--line2);
  background: var(--metal-hi); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 2px 0 #000; transition: all .15s; white-space: nowrap; font-family: var(--body); color: var(--txt); }
.chip:hover:not(.off) { border-color: var(--hazard); transform: translateY(-1px); }
.chip.off { opacity: .45; cursor: not-allowed; }
.chip.used { opacity: .35; text-decoration: line-through; cursor: default; }
.chip .ic { width: 16px; height: 16px; }
.chip .k { font-family: var(--num); font-size: 15px; }
.chip.def { background: linear-gradient(180deg, #33302a, #23211d); }
.chip.abil { border-color: #2f5f86; background: linear-gradient(180deg, #213444, #192530); }
.chip.perm { border-color: #5a3d86; background: linear-gradient(180deg, #2c2240, #1f182d); }
.chip .lim { font-family: var(--num); font-size: 11px; padding: 0 5px; border-radius: 4px; background: #000a; color: var(--dim); }
.chip.hot { border-color: var(--hazard); box-shadow: 0 0 12px rgba(246,194,28,.35), inset 0 1px 0 rgba(255,255,255,.08); }

/* 最近动态（淡出） */
.feed { position: absolute; right: 12px; top: 56px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; pointer-events: none; z-index: 4; max-width: 46%; }
.feed .fe { background: rgba(10,10,12,.78); border: 1px solid #0006; border-radius: 8px; padding: 4px 10px; font-size: 12.5px; color: var(--dim); animation: fein .3s ease-out; transition: opacity .8s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.feed .fe b { color: var(--txt); font-weight: 600; }
.feed .fe.old { opacity: 0; }
@keyframes fein { from { transform: translateX(14px); opacity: 0; } }

/* 侧边栏：记录 / 聊天 / 规则（宽屏占一列不挡桌面；其他情况浮在右边） */
.side { position: absolute; top: 46px; right: 0; bottom: var(--bottomH, 214px); width: 320px; display: none; flex-direction: column; min-height: 0; z-index: 40;
  background: linear-gradient(180deg, rgba(27,29,33,.98), rgba(20,21,24,.98)); border-left: 1px solid #000; box-shadow: -10px 0 30px rgba(0,0,0,.6); }
.game.side-on .side { display: flex; animation: sidein .25s cubic-bezier(.3,.7,.3,1); }
@keyframes sidein { from { transform: translateX(40px); opacity: 0; } }
.game.side-on.side-dock { grid-template-columns: var(--boardW, 300px) 1fr var(--sideW, 320px); }
.game.side-dock .side { position: relative; top: auto; right: auto; bottom: auto; width: auto; grid-row: 2; grid-column: 3; box-shadow: -8px 0 24px rgba(0,0,0,.5); animation: none; }
.side-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.side-tabs .btn { flex: 1; }
.side-tabs .btn.on { border-color: var(--hazard); color: var(--hazard); }
.side-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 10px; }
.log .e { font-size: 12.5px; line-height: 1.65; color: var(--dim); padding: 1px 0; }
.log .e b { color: var(--txt); font-weight: 600; }
.log .e .dot { width: 8px; height: 8px; margin-right: 5px; transform: translateY(-1px); }
.log .e.turn { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--hazard); font-family: var(--zh); }
.log .e.big { color: #ffe08a; }
.log .e.chat { color: var(--txt); }
.chatbar { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chatbar input { flex: 1; min-width: 0; background: #0c0d0f; color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.rules-aid img { width: 100%; border-radius: 10px; margin-bottom: 10px; cursor: zoom-in; }
.rules-txt { font-size: 13px; line-height: 1.75; color: var(--dim); }
.rules-txt h4 { color: var(--hazard); font-family: var(--zh); font-weight: 400; margin: 12px 0 4px; font-size: 15px; letter-spacing: .05em; }
.rules-txt b { color: var(--txt); }

/* 我的回合：边框呼吸 */
.game.myturn::after { content: ''; position: absolute; inset: 46px 0 0 0; pointer-events: none; border: 2px solid color-mix(in srgb, var(--pc) 55%, transparent); border-radius: 2px; animation: mybreath 2.4s ease-in-out infinite; z-index: 60; }
@keyframes mybreath { 50% { border-color: color-mix(in srgb, var(--pc) 20%, transparent); } }
.game.busy .hand, .game.busy .chip, .game.busy .board .act { pointer-events: none; }
