/* Trận đấu (ngang): sân địch trên, sân ta dưới, tay ở đáy, ATP bên phải, máu hai tướng bên trái (docs/07). */
.screen.battle {
  --unit-h: clamp(5.5rem, 29vh, 14rem);
  --hand-h: clamp(5rem, 27vh, 13rem);
  --river-shift: 12vh; /* dịch dòng sông của ảnh nền lên trên (tăng số này = sông lên cao hơn) */
  position: relative; display: grid; grid-template-columns: minmax(7.5rem, 10.5rem) minmax(0, 1fr) minmax(8.5rem, 11.5rem); gap: 0.5rem;
  height: 100%; padding: calc(0.4rem + var(--safe-top)) calc(0.5rem + var(--safe-right)) calc(0.4rem + var(--safe-bottom)) calc(0.5rem + var(--safe-left));
  overflow: hidden; color: var(--ink);
  background: #7ea25b url('../assets/maps/board_bg_land.png') center calc(50% - var(--river-shift)) / cover no-repeat;
}
.battle .rotate-notice { display: none; }
.battle-back { position: absolute; z-index: 5; left: calc(0.4rem + var(--safe-left)); top: calc(0.3rem + var(--safe-top)); }
.battle-back .back { width: 2.75rem; height: 2.75rem; }

.col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.col-left { align-items: center; justify-content: space-between; padding-top: 2.9rem; gap: 0.4rem; }
.col-right { gap: 0.4rem; justify-content: flex-start; }
.spacer { flex: 1; min-height: 0; }

/* Tướng */
.hero { position: relative; width: clamp(5rem, 24vh, 10rem); aspect-ratio: 1; flex: none; border-radius: 50%; }
.hero-ring { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: rgb(243 230 207 / 0.9); border: 3px dashed #8d6a43; }
.hero-ring img { width: 100%; height: 100%; object-fit: cover; }
.hero-name { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; line-height: 1.1; padding-inline: 0.3rem; color: #3a2616; text-shadow: 0 0 4px #fff6e0, 0 0 4px #fff6e0; }
.hero-hp, .hero-armor { position: absolute; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; }
.hero-hp { right: -0.3rem; bottom: -0.3rem; width: 2.7rem; height: 2.7rem; }
.hero-armor { right: -0.3rem; top: -0.1rem; }
.hero img, .unit img { -webkit-user-drag: none; }
.hero-hp img, .hero-armor img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-hp b, .hero-armor b, .unit-stat b, .unit-armor b {
  position: relative; font-family: var(--font-display); font-weight: 800; color: #fff; -webkit-text-stroke: 3px #3a2616; paint-order: stroke fill; line-height: 1;
}
.hero-hp b { font-size: 1.3rem; }
.hero-armor b { font-size: 1rem; }
.hero.is-target .hero-ring { border: 3px solid #e0402a; animation: target-pulse 0.8s ease-in-out infinite; }
.hero.is-target { cursor: crosshair; }

.buff-box { width: 100%; display: flex; flex-direction: column; gap: 0.35rem; align-items: stretch; }
.buffs { display: flex; gap: 0.35rem; justify-content: center; }
.buff-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; min-width: 2.9rem; min-height: 2.9rem; flex: 1; padding: 0.2rem; border: 2px solid #5a2a1c; border-radius: 0.7rem; background: #a83e28; color: #fff; }
.buff-slot small { font-size: 0.65rem; font-weight: 800; line-height: 1.05; text-align: center; }
.buff-slot.locked { background: #8d6a43; opacity: 0.9; }
.buff-slot.done { background: #4d7c3a; border-color: #2c4a22; }
.buff-q { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; line-height: 1; }
.decode { min-height: 2.75rem; padding: 0.2rem 0.5rem; font-size: 1rem; }

/* Giữa: sân */
.center { display: flex; flex-direction: column; min-height: 0; min-width: 0; gap: 0.2rem; }
.enemy-hand { flex: none; display: flex; justify-content: center; gap: 0.35rem; height: 1.2rem; }
.enemy-hand i { width: 1.1rem; height: 100%; border-radius: 0.2rem; background: #8b6a43; border: 1px solid #5a4028; }
.board { flex: 1 1 0; min-height: 0; display: flex; justify-content: center; align-items: center; gap: 0.4rem; }
.river { flex: none; height: clamp(1rem, 7vh, 2.2rem); } /* dòng sông đã có sẵn trong ảnh nền */

.unit {
  position: relative; flex: 0 1 auto; height: min(100%, var(--unit-h)); aspect-ratio: 3 / 4; min-width: 0; padding: 0.2rem; border: 3px solid var(--rarity-line, #a89c84); border-radius: 0.7rem;
  background: #f6ecd6; box-shadow: 0 3px 0 rgb(58 38 22 / 0.4); text-align: center; transition: transform 140ms, box-shadow 140ms;
}
.unit-art { display: block; height: 62%; border-radius: 0.45rem; overflow: hidden; background: #cfc2a5; }
.unit-art img { width: 100%; height: 100%; object-fit: cover; }
.unit-name { display: block; margin-top: 0.1rem; font-family: var(--font-display); font-weight: 800; font-size: clamp(0.6rem, 1.9vh, 0.78rem); line-height: 1.05; color: #3a2616; max-height: 2.1em; overflow: hidden; }
.unit-icons { position: absolute; left: 0.15rem; right: 0.15rem; top: 0.15rem; display: flex; flex-direction: row; flex-wrap: wrap; gap: 1px; pointer-events: none; }
.unit-icons img { width: clamp(1.2rem, 4.6vh, 1.8rem); height: clamp(1.2rem, 4.6vh, 1.8rem); filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.5)); }
.unit-stat, .unit-armor { position: absolute; display: grid; place-items: center; width: clamp(1.6rem, 6.5vh, 2.2rem); height: clamp(1.6rem, 6.5vh, 2.2rem); }
.unit-stat img, .unit-armor img { position: absolute; inset: 0; width: 100%; height: 100%; }
.unit-stat b, .unit-armor b { font-size: clamp(0.9rem, 3.2vh, 1.2rem); }
.unit-stat.atk { left: -0.5rem; bottom: -0.45rem; }
.unit-stat.hp { right: -0.5rem; bottom: -0.45rem; }
.unit-armor { right: -0.45rem; top: -0.45rem; }
.unit-stat.up b { color: #b9f58a; }
.unit-stat.down b { color: #ffb3a7; }
.unit.is-taunt { border-color: #c79a2b; box-shadow: 0 0 0 3px #7a5a12, 0 3px 0 rgb(58 38 22 / 0.4); }
.unit.is-stealth { opacity: 0.7; border-style: dashed; }
.unit.is-stunned .unit-art { filter: grayscale(0.7); }
.unit.can-act { box-shadow: 0 0 0 3px #7bd957, 0 0 14px 2px rgb(123 217 87 / 0.8); cursor: pointer; animation: ready-pulse 1.4s ease-in-out infinite; }
.unit.is-selected { box-shadow: 0 0 0 4px #ffe27a, 0 0 18px 4px rgb(255 226 122 / 0.9); transform: translateY(-6px); animation: none; }
.unit.is-target { box-shadow: 0 0 0 4px #e0402a, 0 0 16px 3px rgb(224 64 42 / 0.9); cursor: crosshair; animation: target-pulse 0.8s ease-in-out infinite; }
.unit.summon-wait { opacity: 0; }
.unit.pop { animation: unit-pop 320ms cubic-bezier(.2,.9,.3,1.3); }
.unit.shake, .hero.shake { animation: shake 280ms; }
@keyframes ready-pulse { 50% { box-shadow: 0 0 0 3px #7bd957, 0 0 6px 1px rgb(123 217 87 / 0.5); } }
@keyframes target-pulse { 50% { transform: scale(1.05); } }
@keyframes unit-pop { from { transform: scale(0.3); opacity: 0; } }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@media (hover: hover) { .unit:hover:not(.is-selected) { transform: translateY(-3px); } }

/* Tay bài */
.hand { flex: none; height: var(--hand-h); display: flex; justify-content: center; align-items: flex-end; padding-top: 0.6rem; }
.hand-card { flex: none; width: calc(var(--hand-h) * 0.66); margin-left: calc(var(--hand-h) * -0.2); transform: rotate(var(--tilt, 0deg)); transform-origin: 50% 120%; transition: transform 140ms, margin 140ms; cursor: pointer; }
.hand-card:first-child { margin-left: 0; }
.hand-card.tile .tile-name { font-size: 0.7rem; min-height: 2.1em; }
.hand-card.is-playable { box-shadow: 0 0 0 3px #7bd957, 0 0 12px rgb(123 217 87 / 0.8); }
@media (hover: hover) { .hand-card:hover { transform: translateY(-1.2rem) scale(1.08) rotate(0); z-index: 5; } }
.hand-card.is-dim { filter: grayscale(0.7) brightness(0.9); }

/* Cột phải */
.info { padding: 0.35rem 0.6rem; border: 2px solid var(--panel-line); border-radius: 0.8rem; background: var(--panel); font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; line-height: 1.25; text-align: center; }
.btn-info { min-height: 2.75rem; font-weight: 800; }
.end-turn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; min-height: 4.2rem; padding: 0.4rem; border: 3px solid var(--green-deep); border-radius: 1rem;
  background: var(--green); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1.1; box-shadow: 0 4px 0 rgb(30 60 20 / 0.6);
}
.end-turn img { width: 2.4rem; height: 2.4rem; }
.end-turn:disabled { opacity: 0.45; box-shadow: none; filter: saturate(0.5); }
.end-turn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgb(30 60 20 / 0.6); }
.end-turn.is-done { animation: done-pulse 1.1s ease-in-out infinite; }
@keyframes done-pulse { 50% { box-shadow: 0 0 0 5px rgb(255 226 122 / 0.8), 0 4px 0 rgb(30 60 20 / 0.6); } }
.atp-box { display: flex; flex-direction: column; gap: 0.25rem; align-items: center; }
.atp-text { color: #1f5aa6; font-size: 1.15rem; }
.atp-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem; }
.atp-dots i { width: 0.85rem; height: 0.85rem; border-radius: 50%; background: #d9c8a4; border: 1px solid #8d6a43; }
.atp-dots i.on { background: #4a86e0; border-color: #1f4a94; }

/* Thông báo */
.turn-banner { position: absolute; z-index: 20; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(0.6); padding: 0.5rem 2rem; border-radius: 999px; background: rgb(58 38 22 / 0.88); color: #ffe27a; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem, 7vh, 2.4rem); white-space: nowrap; opacity: 0; pointer-events: none; }
.turn-banner.show { animation: banner 1.5s ease-out; }
@keyframes banner { 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }
.prompt { position: absolute; z-index: 15; left: 50%; bottom: calc(var(--hand-h) + 1rem); transform: translateX(-50%); display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.5rem 0.35rem 1rem; border: 2px solid #5a2a1c; border-radius: 999px; background: #fff0c9; font-family: var(--font-display); font-weight: 800; font-size: 1rem; white-space: nowrap; box-shadow: var(--lift); }
.prompt .cancel { min-height: 2.5rem; padding: 0.1rem 0.9rem; font-size: 0.9rem; }
/* Khung avatar địch + nhãn "Đối thủ đang nghĩ" nằm ngay bên phải, không che bài trên tay địch */
.hero-wrap { position: relative; flex: none; }
.thinking { position: absolute; z-index: 6; left: calc(100% + 0.25rem); top: 50%; transform: translateY(-50%); width: max-content; max-width: 6.5rem; padding: 0.2rem 0.7rem; border-radius: 0.9rem; background: rgb(58 38 22 / 0.85); color: #fff6e0; font-weight: 800; font-size: 0.8rem; line-height: 1.2; text-align: center; pointer-events: none; }
.float-num { position: fixed; z-index: 95; pointer-events: none; font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; -webkit-text-stroke: 4px #3a2616; paint-order: stroke fill; line-height: 1; }
.float-num.dmg { color: #ff6b5e; }
.float-num.heal { color: #8be06a; }
.float-num.armor { color: #b9e4ff; }

/* Cửa sổ xem thẻ / chọn thẻ */
.inspect-backdrop { align-items: center; }
.inspect { position: relative; padding: 0.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.inspect-card { width: min(16rem, 52vh); }
.inspect-info, .inspect-actions { display: flex; flex-direction: column; gap: 0.5rem; max-width: 14rem; }
.pick-box { width: min(100%, 44rem); }
.pick-row { display: flex; gap: 0.8rem; justify-content: center; }
.pick-card { width: min(30%, 10rem, 38vh); border-radius: 0.8rem; }
.pick-card:not(.static):hover { transform: translateY(-4px); }
.pick-card:focus-visible { outline: 3px solid #ffe27a; }
.log-box ol { padding-left: 1.2rem; max-height: 60vh; overflow-y: auto; font-size: 0.95rem; }
.decode-box { width: min(100%, 34rem); }
.decode-q { font-weight: 800; font-size: 1.1rem; }
.decode-box .opt { justify-content: flex-start; text-align: left; }
.decode-box .opt.right { background: #cfe8b8; border-color: var(--green); }
.decode-box .opt.wrong { background: #f2c3b8; border-color: var(--danger); }
.decode-buff { display: flex; gap: 0.7rem; align-items: center; margin-top: 0.6rem; padding: 0.6rem 0.8rem; border: 2px solid var(--green); border-radius: 0.8rem; background: #e6f3d6; text-align: left; }
.decode-buff b { font-family: var(--font-display); font-size: 1.1rem; }
.decode-buff p { margin: 0.15rem 0 0; font-size: 0.95rem; line-height: 1.3; }
.decode-explain { margin-top: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 0.7rem; background: #fff0c9; font-size: 0.95rem; }

/* Kết thúc trận: một khung giữa màn, xếp dọc: tiêu đề → (thưởng + lời nhắn) → nút. Không có ô cuộn riêng. */
.battle-end { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 0.8rem 1rem; overflow-y: auto; color: #fff6e0; animation: fade-in 300ms;
  background: radial-gradient(ellipse at 50% 30%, #5a3f26 0%, #3a2818 60%, #2a1c10 100%); }
.end-panel { width: min(100%, 44rem); margin: auto; display: flex; flex-direction: column; align-items: center; gap: clamp(0.4rem, 2.2vh, 0.9rem); text-align: center; }
.end-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 12vh, 4rem); line-height: 1.05; text-transform: uppercase; letter-spacing: 0.02em; }
.end-title.win { color: #f5c842; text-shadow: 0 0 1.2rem rgb(245 200 66 / 0.55), 0 3px 0 #8a5a12; }
.end-title.lose { color: #e8a090; text-shadow: 0 3px 0 #6b2a1e; }
.end-rule { width: min(16rem, 60%); height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #f5c842, transparent); opacity: 0.8; }
.is-lose .end-rule { background: linear-gradient(90deg, transparent, #e8a090, transparent); }
.end-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.8rem 1.6rem; width: 100%; }
.end-art { flex: none; display: grid; place-items: center; }
.end-reward-title { font-family: var(--font-display); font-size: 1.1rem; color: #f5c842; margin: 0; }
.reward-card { width: min(9rem, 27vh); border-radius: 1rem; filter: drop-shadow(0 0 1rem rgb(255 200 80 / 0.7)); }
.reward-card.landed { animation: landed 0.5s ease-out; }
.reward-card.r-SP { filter: drop-shadow(0 0 1.2rem rgb(224 64 42 / 0.9)); }
.end-text { flex: 0 1 28rem; display: flex; flex-direction: column; gap: 0.45rem; font-size: clamp(0.85rem, 3.4vh, 1.05rem); line-height: 1.35; }
.end-art + .end-text { text-align: left; align-items: flex-start; }
.end-line { margin: 0; color: #f3e7cc; font-weight: 600; text-wrap: balance; }
.end-line.strong { color: #fff6e0; font-weight: 800; }
.end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; width: 100%; margin-top: 0.2rem; }
.end-actions .btn { flex: 0 1 auto; min-width: 8.5rem; }
.end-actions .btn-light { background: #f3e6c9; }
.muted-light { color: #e8d9b8; font-weight: 600; }

/* Màn dọc: nhắc xoay ngang */
@media (orientation: portrait) and (max-width: 900px) {
  .screen.battle > :not(.rotate-notice) { display: none !important; }
  .screen.battle .rotate-notice { display: flex; flex-direction: column; gap: 1rem; align-items: center; justify-content: center; grid-column: 1 / -1; background: #3a2818; color: #fff6e0; padding: 2rem; text-align: center; position: absolute; inset: 0; z-index: 30; font-family: var(--font-display); font-size: 1.4rem; }
}
/* Điện thoại ngang thấp: thu gọn */
@media (max-height: 420px) {
  .screen.battle { grid-template-columns: 6.8rem minmax(0, 1fr) 7.8rem; gap: 0.35rem; }
  .hero { width: 4.6rem; }
  .info { font-size: 0.78rem; padding: 0.25rem 0.4rem; }
  .end-turn { min-height: 3.2rem; font-size: 1rem; }
  .end-turn img { display: none; }
  .btn-info { min-height: 2.75rem; }
}

/* ───── Khoe lá bài khi ra bài ───── */
.showcase { position: absolute; inset: 0; z-index: 35; pointer-events: none; background: radial-gradient(ellipse at center, rgb(20 12 4 / 0.55), rgb(20 12 4 / 0.2) 70%); }
.showcase-light { background: none; }
.showcase-card { position: absolute; filter: drop-shadow(0 0 22px var(--glow, #fff)) drop-shadow(0 0 6px var(--glow, #fff)); }
.showcase-arrow { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.arrow-line { fill: none; stroke: #ffe27a; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 14 10; animation: arrow-flow 0.6s linear infinite; }
.arrow-head { fill: #fff3b0; stroke: #ffb43a; stroke-width: 3; stroke-linejoin: round; }
.arrow-ring { fill: none; stroke: #fff3b0; stroke-width: 4; animation: arrow-ring 0.8s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes arrow-flow { to { stroke-dashoffset: -48; } }
@keyframes arrow-ring { from { opacity: 1; transform: scale(0.6); } to { opacity: 0; transform: scale(1.6); } }
.showcase-text {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); max-width: 80%; padding: 0.45rem 1.1rem; border: 2px solid #ffe27a; border-radius: 999px;
  background: rgb(58 38 22 / 0.92); color: #ffe27a; font-family: var(--font-display); font-weight: 800; font-size: clamp(0.9rem, 3.2vh, 1.25rem); text-align: center; line-height: 1.25;
}
.spell-rect {
  position: absolute; border: 4px solid var(--glow, #fff); border-radius: 1rem; background: linear-gradient(135deg, rgb(179 119 240 / 0.45), rgb(255 255 255 / 0.25), rgb(106 55 184 / 0.5));
  box-shadow: 0 0 30px 6px var(--glow, #fff), inset 0 0 30px rgb(255 255 255 / 0.6);
}

/* ───── Ô ATP: biểu tượng sét, tối đa 10 / hàng ───── */
.atp-bolts { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 0.1rem; width: 100%; }
.atp-bolts img { width: 100%; aspect-ratio: 1; opacity: 0.28; filter: grayscale(1); transition: opacity 160ms, filter 160ms; }
.atp-bolts img.on { opacity: 1; filter: drop-shadow(0 0 3px #ffd447); }

/* ───── Nút kết thúc lượt: nháy mạnh khi không còn gì để chơi ───── */
.end-turn.is-done { animation: done-pulse 0.8s ease-in-out infinite; background: #f0a21b; border-color: #a86a0a; color: #3a2616; }
@keyframes done-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgb(255 226 122 / 0.9), 0 4px 0 rgb(120 70 10 / 0.7); } 50% { transform: scale(1.07); box-shadow: 0 0 0 10px rgb(255 226 122 / 0), 0 0 22px 6px rgb(255 214 71 / 0.95), 0 4px 0 rgb(120 70 10 / 0.7); } }

/* ───── Quân sẵn sàng đánh / chưa đánh được ───── */
.unit.can-act::before {
  content: ''; position: absolute; z-index: 3; top: -0.9rem; left: 50%; width: 1.7rem; height: 1.7rem; transform: translateX(-50%);
  background: url('../assets/icons/stat_atk.png') center / contain no-repeat; filter: drop-shadow(0 0 5px #7bd957); animation: bob 0.9s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, -4px); } }
.unit.is-rest { filter: saturate(0.55) brightness(0.88); border-style: dashed; }
.unit.is-rest::after {
  content: 'Zzz'; position: absolute; z-index: 3; top: 28%; left: 50%; transform: translateX(-50%) rotate(-8deg); padding: 0.05rem 0.5rem; border-radius: 999px;
  background: rgb(40 30 60 / 0.85); color: #cfd8ff; font: 800 clamp(0.7rem, 2.2vh, 1rem)/1.2 var(--font-display); pointer-events: none;
}

/* ───── Kéo lá bài lên để ra nhanh ───── */
.hand-card { touch-action: none; }
.hand-card.is-dragging { z-index: 30; transition: none; margin-left: calc(var(--hand-h) * -0.2); cursor: grabbing; filter: drop-shadow(0 8px 12px rgb(0 0 0 / 0.5)); }
.hand-card.will-play { box-shadow: 0 0 0 4px #ffe27a, 0 0 24px 8px rgb(255 226 122 / 0.9); }

/* ───── Xem quân trên sân: chỉ số + hiệu ứng đang có ───── */
.inspect-info { max-width: min(22rem, 100%); }
.inspect-stats { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip.stat { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 800; }
.chip.stat img { width: 1.5rem; height: 1.5rem; }
.chip.stat b { font-size: 1.15rem; }
.inspect-status { display: flex; flex-direction: column; gap: 0.4rem; max-height: 46vh; overflow-y: auto; }
.status-row { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.4rem 0.6rem; border: 2px solid var(--panel-line); border-radius: 0.8rem; background: var(--panel); }
.status-row.bad { border-color: #b33a2c; background: #f9e1db; }
.status-row img { width: 2.2rem; height: 2.2rem; flex: none; }
.status-row p { margin: 0.1rem 0 0; font-size: 0.85rem; line-height: 1.3; }
.kw-name { color: var(--keyword); }
.muted-light { color: #fff6e0; font-weight: 700; }

/* ───── Xoay bài đầu trận ───── */
.mull-box { width: min(100%, 52rem); }
.mull-row { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin: 0.6rem 0; }
.mull-card { position: relative; width: clamp(5.5rem, 30vh, 9rem); padding: 0; border: 3px solid transparent; border-radius: 0.8rem; background: none; cursor: pointer; transition: transform 140ms; }
.mull-card .tile { pointer-events: none; }
.mull-mark { position: absolute; left: 50%; top: 40%; transform: translateX(-50%) scale(0); padding: 0.1rem 0.6rem; border-radius: 999px; background: #d3382a; color: #fff; font: 800 1rem/1.2 var(--font-display); transition: transform 140ms; }
.mull-card.is-picked { transform: translateY(-8px) rotate(-3deg); border-color: #d3382a; box-shadow: 0 0 14px 2px rgb(211 56 42 / 0.8); }
.mull-card.is-picked .mull-mark { transform: translateX(-50%) scale(1); }
.mull-card.is-locked-card { opacity: 0.55; cursor: default; }
.mull-card.is-locked-card .mull-mark { transform: translateX(-50%) scale(1); background: #6b4a3a; }

/* ───── Chọn lá: các lá chui từ bộ bài ra, lật ngửa ───── */
.pick-card { animation: deal-from-deck 0.55s cubic-bezier(.2,.9,.3,1) both; animation-delay: calc(var(--i, 0) * 0.18s); backface-visibility: hidden; }
@keyframes deal-from-deck {
  from { opacity: 0; transform: translate(40vw, 30vh) rotateY(180deg) scale(0.4); }
  60% { opacity: 1; transform: translate(0, -6px) rotateY(90deg) scale(1.05); }
  to { opacity: 1; transform: none; }
}
.pick-card.is-leaving { animation: none; transition: transform 0.4s ease-in, opacity 0.4s; transform: translate(0, 40vh) scale(0.5); opacity: 0; }
.pick-card.is-leaving-up { animation: none; transition: transform 0.4s ease-in, opacity 0.4s; transform: translate(40vw, -20vh) rotateY(180deg) scale(0.4); opacity: 0; }

/* Dòng nhắc + mô tả chọn mục tiêu: để ở dưới (phía trên tay bài) cho khỏi che quân địch cần chọn */
.prompt { top: auto; bottom: calc(0.4rem + var(--safe-bottom)); }
/* Hộp mô tả kĩ năng ngay dưới dòng nhắc chọn mục tiêu */
.prompt-desc { position: absolute; z-index: 15; left: 50%; top: auto; bottom: calc(0.4rem + var(--safe-bottom) + 3.4rem); transform: translateX(-50%); width: max-content; max-width: min(34rem, 56vw); padding: 0.4rem 0.9rem; border: 2px solid #5a2a1c; border-radius: 0.9rem; background: #fffaf0; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; line-height: 1.3; color: #3a2616; box-shadow: var(--lift); pointer-events: none; }
.prompt-desc.hide { display: none; }

/* Dấu kiếm trên quân sẵn sàng tấn công */
