/* 手牌（杀戮尖塔式）、牌堆、结束按钮 */
.handwrap { position: relative; flex: 1; height: 100%; min-width: 0; }
.hand { position: absolute; inset: 0; }
.hc { position: absolute; left: 0; bottom: 4px; width: var(--cw); height: calc(var(--cw) * 1.393); transform-origin: 50% 100%; transition: transform .22s cubic-bezier(.25,.8,.3,1), filter .2s; touch-action: none; cursor: pointer; will-change: transform; }
.hc-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .15s ease-out; }
.hc.focus .hc-in { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.hc-glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s; mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255,255,255,.75), rgba(255,255,255,0) 55%); }
.hc.focus .hc-glare { opacity: 1; }
.hc-face, .hc-back { position: absolute; inset: 0; border-radius: calc(var(--cw) * .065); overflow: hidden; backface-visibility: hidden; box-shadow: 0 6px 14px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.6); }
.hc-face img { width: 100%; height: 100%; display: block; pointer-events: none; }
.hc-back { transform: rotateY(180deg); background: url('../assets/cards/back_card.webp') center / cover; }
.hc-x { position: absolute; inset: 0; border-radius: calc(var(--cw) * .065); pointer-events: none; transition: box-shadow .2s; }
.hc.act .hc-x { box-shadow: 0 0 0 2px rgba(102,224,138,.75), 0 0 14px rgba(102,224,138,.35); }
.hc.act.nomain .hc-x { box-shadow: 0 0 0 2px rgba(255,170,60,.65), 0 0 12px rgba(255,150,40,.25); }
.hc.idle { filter: brightness(.82) saturate(.85); }
.hc.focus { filter: none; }
.hc.focus .hc-face { box-shadow: 0 18px 40px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.6); }
.hc.sel .hc-x { box-shadow: 0 0 0 3px var(--hazard), 0 0 26px rgba(246,194,28,.55); }
.hc.dmg .hc-face { box-shadow: 0 6px 14px rgba(0,0,0,.6), 0 0 0 2px rgba(255,80,60,.6); }
.hc.dragging { transition: none; z-index: 500 !important; filter: drop-shadow(0 20px 30px rgba(0,0,0,.6)); cursor: grabbing; }
.hc.ghost { pointer-events: none; }
body.dragging-card, body.dragging-card * { cursor: grabbing !important; }

/* 选中 / 悬停时旁边的说明面板 */
.handpanel { position: absolute; bottom: 8px; z-index: 400; width: 250px; display: none; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(30,32,36,.97), rgba(18,19,22,.98)); border: 1px solid var(--line2); box-shadow: 0 12px 30px rgba(0,0,0,.7); font-size: 13px; line-height: 1.5; pointer-events: none; }
.handpanel.on { display: flex; animation: hpin .16s ease-out; }
.handpanel.btns { pointer-events: auto; border-color: var(--hazard); }
@keyframes hpin { from { opacity: 0; transform: translateY(6px); } }
.hp-hint { font-size: 11.5px; color: var(--dim2); border-top: 1px solid var(--line); padding-top: 6px; }
.hp-acts { display: flex; flex-direction: column; gap: 6px; }
.pa { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; border-radius: 9px; cursor: pointer; text-align: left; border: 1px solid var(--line2); background: var(--metal-hi); color: var(--txt); transition: all .15s; font-size: 13px; }
.pa:hover:not(:disabled) { border-color: var(--hazard); transform: translateX(2px); }
.pa.pri { border-color: #8a6a12; background: linear-gradient(180deg, #3e3418, #2a2410); }
.pa:disabled { opacity: .5; cursor: not-allowed; }
.pa-k { font-family: var(--zh); color: #ffe08a; display: inline-flex; align-items: center; gap: 3px; }
.pa-k.burn { color: #ffb36b; }
.pa-c { color: #ff9a7a; display: inline-flex; align-items: center; }
.pa-g { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pa-why { width: 100%; font-size: 11.5px; color: var(--bad); }
.pa-warn { width: 100%; font-size: 11px; color: #ffcf7a; opacity: .85; }

/* 牌堆 / 弃牌堆 */
.pile { flex: none; width: var(--pileW, 92px); height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding-bottom: 6px; cursor: pointer; position: relative; }
.pl-stack { position: relative; width: calc(var(--cw) * .66); height: calc(var(--cw) * .66 * 1.393); }
.pl-stack > i { position: absolute; inset: 0; border-radius: 6px; background: url('../assets/cards/back_card.webp') center / cover; box-shadow: 0 2px 4px rgba(0,0,0,.7); transform: translate(calc(var(--i) * 2px), calc(var(--i) * -2px)); }
.pl-top { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 6px; box-shadow: 0 4px 10px rgba(0,0,0,.7); transform: translate(4px, -6px); }
.pl-top.back { background: url('../assets/cards/back_card.webp') center / cover; }
.pl-empty { position: absolute; inset: 0; border-radius: 6px; border: 2px dashed #3a3f47; display: flex; align-items: center; justify-content: center; color: var(--dim2); font-size: 12px; }
.pl-lbl { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--dim); white-space: nowrap; font-family: var(--zh); }
.pl-lbl .ic { width: 14px; height: 14px; }
.pl-lbl b { color: var(--txt); font-weight: 400; font-size: 16px; font-family: var(--num); }
.pl-peek { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 10px; padding: 0 6px; border-radius: 6px; background: #000c; color: var(--hazard); white-space: nowrap; }
.pl-rm { font-size: 10.5px; color: var(--dim2); }
.pile:hover .pl-stack { transform: translateY(-3px); transition: transform .2s; }

/* 结束按钮 */
.enddock { flex: none; width: var(--endW, 118px); height: 100%; display: flex; align-items: center; justify-content: center; padding-bottom: 6px; }
.endbtn { width: var(--endBtn, 108px); height: var(--endBtn, 108px); border-radius: 50%; border: 3px solid #3a3f47; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: radial-gradient(circle at 50% 35%, #3a3f47, #1d2024 70%); color: var(--dim); box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 6px 16px rgba(0,0,0,.7); transition: transform .12s, filter .2s; }
.endbtn .eb-l { font-size: 17px; letter-spacing: .06em; }
.endbtn .eb-s { font-size: 11px; opacity: .8; max-width: 92px; text-align: center; line-height: 1.25; }
.endbtn.on { color: #1d1405; border-color: #ffe08a; background: radial-gradient(circle at 50% 30%, #ffe28a, #f6c21c 50%, #b97f08 100%); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 6px 16px rgba(0,0,0,.7), 0 0 24px rgba(246,194,28,.45); animation: endglow 2s ease-in-out infinite; }
.endbtn.on.surf { background: radial-gradient(circle at 50% 30%, #c6f0ff, #3d9cff 55%, #155aa8 100%); border-color: #bfe4ff; color: #04152a; box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 6px 16px rgba(0,0,0,.7), 0 0 24px rgba(61,156,255,.45); }
.endbtn.on.upk { background: radial-gradient(circle at 50% 30%, #c8ffd6, #2fc274 55%, #157a42 100%); border-color: #c8ffd6; color: #04220f; box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 6px 16px rgba(0,0,0,.7), 0 0 24px rgba(47,194,116,.45); }
.endbtn:hover:not(:disabled) { transform: scale(1.05); filter: brightness(1.08); }
.endbtn:active:not(:disabled) { transform: scale(.97); }
.endbtn:disabled { cursor: default; }
@keyframes endglow { 50% { box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 6px 16px rgba(0,0,0,.7), 0 0 36px rgba(246,194,28,.7); } }
