/* =====================================================================
   SÀN ĐẤU BOSS HÙNG HAM HỐ
   ===================================================================== */
.bz {
  --rage: 0;
  border: 2.5px solid var(--outline);
  border-radius: 18px;
  overflow: hidden;
  background: #2b1d14;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
  user-select: none;
  -webkit-user-select: none;
}

/* ---- Thanh tên + máu ---- */
.bz-top {
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, #3b2418, #2b1d14);
  border-bottom: 2.5px solid var(--outline);
  color: #fff;
}
.bz-name { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 7px; flex-wrap: wrap; }
.bz-name b { font-size: 18px; font-weight: 900; letter-spacing: .5px; text-shadow: 0 2px 0 #000; }
.bz-skull { font-size: 20px; }
.bz-lv {
  font-size: 12px; font-weight: 800;
  padding: 2px 9px; border-radius: 99px;
  background: #fab005; color: #2b1d14; border: 2px solid #000;
}
.bz-lv i { font-style: normal; }
.bz-lv.bump { animation: bz-bump .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bz-bump { 0% { transform: scale(1); } 40% { transform: scale(1.6) rotate(-6deg); } 100% { transform: scale(1); } }
.bz-rage-tag {
  display: none;
  font-size: 11px; font-weight: 900;
  padding: 2px 8px; border-radius: 99px;
  background: #e03131; border: 2px solid #000;
  animation: bz-blink .6s steps(2) infinite;
}
.bz.rage .bz-rage-tag { display: inline-block; }
@keyframes bz-blink { 50% { opacity: .45; } }

.bz-hp {
  position: relative;
  max-width: 560px; height: 26px; margin: 0 auto;
  background: #1a1a1a;
  border: 2.5px solid #000;
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, .6);
}
.bz-hp-ghost, .bz-hp-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.bz-hp-ghost { background: #ffe066; transition: width .7s ease-out .1s; }
.bz-hp-fill {
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .14) 0 8px, transparent 8px 16px),
    linear-gradient(180deg, #ff8787, #e03131 55%, #c92a2a);
  transition: width .18s ease-out;
  animation: bz-stripes 1s linear infinite;
}
.bz-hp-fill.low { animation: bz-stripes 1s linear infinite, bz-blink .5s steps(2) infinite; }
@keyframes bz-stripes { to { background-position: 32px 0, 0 0; } }
.bz-hp-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 900; color: #fff;
  text-shadow: 0 1px 0 #000, 0 0 4px #000;
}

/* ---- Sân khấu ---- */
.bz-scene {
  position: relative;
  height: 290px;
  overflow: hidden;
  background: linear-gradient(180deg, #5c3d2e 0%, #7a5240 62%, #4a3226 62%);
}
.bz.rage .bz-scene { animation: bz-rage-bg 1.4s ease-in-out infinite; }
@keyframes bz-rage-bg { 50% { box-shadow: inset 0 0 60px rgba(224, 49, 49, .55); } }
.bz-bg { position: absolute; inset: 0; pointer-events: none; }
.bz-window {
  position: absolute; left: 50%; top: 22px; transform: translateX(-50%);
  width: 150px; height: 82px;
  background: linear-gradient(180deg, #1c2a5a, #3b4f8f);
  border: 5px solid #3b2418; border-radius: 8px;
  box-shadow: inset 0 0 0 2px #000;
}
.bz-window::before, .bz-window::after { content: ''; position: absolute; background: #3b2418; }
.bz-window::before { left: 50%; top: 0; bottom: 0; width: 4px; transform: translateX(-50%); }
.bz-window::after { top: 50%; left: 0; right: 0; height: 4px; transform: translateY(-50%); }
.bz-window span { position: absolute; right: 12px; top: 6px; font-size: 20px; }
.bz-sign {
  position: absolute; left: 50%; top: 116px; transform: translateX(-50%);
  padding: 3px 12px; border-radius: 6px;
  background: #2b1d14; border: 2px solid #fab005;
  color: #ffd43b; font-size: 12px; font-weight: 900; letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255, 212, 59, .8);
  animation: bz-neon 3s ease-in-out infinite;
}
@keyframes bz-neon { 0%, 100% { opacity: 1; } 48% { opacity: 1; } 50% { opacity: .55; } 52% { opacity: 1; } }
.bz-lamp {
  position: absolute; top: 0; left: 22%;
  width: 2px; height: 52px; background: #222;
  transform-origin: top center;
  animation: bz-swing 3.2s ease-in-out infinite;
}
.bz-lamp2 { left: 78%; animation-delay: -1.6s; }
.bz-lamp i {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  width: 26px; height: 16px; border-radius: 14px 14px 4px 4px;
  background: #fab005; border: 2px solid #000;
  box-shadow: 0 10px 30px 10px rgba(255, 212, 59, .35);
}
@keyframes bz-swing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.bz-table { position: absolute; bottom: 74px; font-size: 22px; }
.bz-table::after {
  content: ''; position: absolute; left: 50%; top: 26px; transform: translateX(-50%);
  width: 54px; height: 8px; border-radius: 4px; background: #3b2418; border: 2px solid #000;
}
.bz-table.t1 { left: 36%; }
.bz-table.t2 { left: 58%; }
.bz-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 60px);
}

/* ---- Người chơi ---- */
.bz-player {
  position: absolute; left: 7%; bottom: 18px;
  width: 120px; height: 150px;
  transform-origin: bottom center;
}
.bz-me { width: 100%; height: 100%; display: block; }
.bz-tag {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  font-size: 11px; font-weight: 900; color: #fff;
  padding: 1px 8px; border-radius: 99px; background: #1971c2; border: 2px solid #000;
}
.bz-player.throw { animation: bz-throw .38s ease-out; }
@keyframes bz-throw { 0% { transform: none; } 35% { transform: translateX(-8px) rotate(-6deg); } 60% { transform: translateX(18px) rotate(5deg); } 100% { transform: none; } }
.bz-player.hit { animation: bz-phit .5s ease-out; }
@keyframes bz-phit {
  0% { transform: none; filter: none; }
  20% { transform: translateX(-16px) rotate(-8deg); filter: brightness(1.6) sepia(1) hue-rotate(-50deg) saturate(5); }
  45% { transform: translateX(6px) rotate(3deg); }
  70% { transform: translateX(-4px); filter: none; }
  100% { transform: none; }
}

/* ---- Boss ---- */
.bz-boss {
  position: absolute; right: 8%; bottom: 14px;
  width: 170px; height: 220px;
  transform-origin: bottom center;
}
.bz-boss-body {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  width: 150px; height: 190px;
  animation: bz-idle 1.3s ease-in-out infinite;
  transform-origin: bottom center;
}
.bz.rage .bz-boss-body { animation-duration: .6s; filter: drop-shadow(0 0 10px rgba(255, 60, 60, .8)) saturate(1.3); }
@keyframes bz-idle {
  0%, 100% { transform: translateX(-50%) scale(1, 1); }
  50% { transform: translateX(-50%) scale(1.04, .96) translateY(2px); }
}
.bz-torso {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 104px; height: 108px;
  border-radius: 46px 46px 18px 18px;
  background: linear-gradient(180deg, #212529 0%, #343a40 100%);
  border: 3px solid #000;
  overflow: hidden;
}
.bz-torso::before {  /* áo ba lỗ */
  content: ''; position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  width: 46px; height: 36px; border-radius: 0 0 50% 50%;
  background: #e8a87c; border: 3px solid #000; border-top: 0;
}
.bz-chain {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  width: 56px; height: 30px;
  border: 4px dotted #fcc419; border-top: 0;
  border-radius: 0 0 30px 30px;
  filter: drop-shadow(0 0 3px rgba(252, 196, 25, .9));
}
.bz-tattoo { position: absolute; right: 8px; bottom: 10px; font-size: 22px; opacity: .85; }
.bz-head {
  position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%);
  font-size: 84px; line-height: 1;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35));
}
.bz-steam { position: absolute; font-size: 22px; opacity: 0; }
.bz-steam.s1 { right: -10px; top: 4px; }
.bz-steam.s2 { left: -14px; top: 10px; }
.bz.rage .bz-steam { animation: bz-steam 1s ease-out infinite; }
.bz.rage .bz-steam.s2 { animation-delay: .5s; }
@keyframes bz-steam { 0% { opacity: 0; transform: scale(.4) translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3) translateY(-26px); } }
.bz-arm {
  position: absolute; bottom: 44px; font-size: 40px;
  transform-origin: 50% 80%;
}
.bz-arm.l { left: -6px; transform: scaleX(-1) rotate(-10deg); animation: bz-flex-l 1.3s ease-in-out infinite; }
.bz-arm.r { right: -6px; transform: rotate(-10deg); animation: bz-flex-r 1.3s ease-in-out infinite; }
@keyframes bz-flex-l { 50% { transform: scaleX(-1) rotate(8deg); } }
@keyframes bz-flex-r { 50% { transform: rotate(8deg); } }
.bz-shadow {
  position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 130px; height: 18px; border-radius: 50%;
  background: rgba(0, 0, 0, .35);
}

/* Boss trúng đòn / né / phản đòn / gục / quay lại */
.bz-boss.hurt .bz-boss-body { animation: bz-hurt .38s ease-out; }
.bz-boss.hurt-big .bz-boss-body { animation: bz-hurt-big .56s ease-out; }
@keyframes bz-hurt {
  0% { transform: translateX(-50%); filter: none; }
  15% { transform: translateX(-44%) scale(.94, 1.06) rotate(5deg); filter: brightness(2.2) saturate(0); }
  45% { transform: translateX(-54%) rotate(-3deg); filter: brightness(1.3) sepia(1) hue-rotate(-40deg) saturate(4); }
  100% { transform: translateX(-50%); filter: none; }
}
@keyframes bz-hurt-big {
  0% { transform: translateX(-50%); filter: none; }
  12% { transform: translateX(-36%) scale(.86, 1.14) rotate(10deg); filter: brightness(3) saturate(0); }
  35% { transform: translateX(-58%) scale(1.1, .9) rotate(-7deg); filter: brightness(1.3) sepia(1) hue-rotate(-40deg) saturate(5); }
  60% { transform: translateX(-47%) rotate(3deg); }
  100% { transform: translateX(-50%); filter: none; }
}
.bz-boss.dodge { animation: bz-dodge .52s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes bz-dodge { 0% { transform: none; } 35% { transform: translateX(40px) translateY(-30px) rotate(12deg); } 100% { transform: none; } }
.bz-boss.lunge { animation: bz-lunge .52s ease-in-out; }
@keyframes bz-lunge { 0% { transform: none; } 25% { transform: translateX(14px) scale(1.05); } 50% { transform: translateX(-70px) scale(1.12) rotate(-6deg); } 100% { transform: none; } }
.bz-boss.ko .bz-boss-body { animation: bz-ko 1.6s cubic-bezier(.4, -0.3, .7, 1) forwards; }
.bz-boss.ko .bz-shadow { animation: bz-fade .8s forwards; }
@keyframes bz-ko {
  0% { transform: translateX(-50%); filter: none; }
  15% { transform: translateX(-50%) scale(1.15, .85); filter: brightness(2); }
  100% { transform: translateX(120%) translateY(-260px) rotate(720deg) scale(.3); opacity: 0; }
}
@keyframes bz-fade { to { opacity: 0; } }
.bz-boss.enter .bz-boss-body { animation: bz-enter .9s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes bz-enter {
  0% { transform: translateX(-50%) translateY(-300px) scale(.8); opacity: 0; }
  60% { transform: translateX(-50%) translateY(0) scale(1.15, .8); opacity: 1; }
  80% { transform: translateX(-50%) scale(.95, 1.05); }
  100% { transform: translateX(-50%); }
}

/* Bóng thoại */
.bz-bubble {
  position: absolute; right: 70%; top: -4px; z-index: 3;
  max-width: 190px; min-width: 110px;
  padding: 7px 11px;
  background: #fff; color: #222;
  border: 2.5px solid #000; border-radius: 14px;
  font-size: 12.5px; font-weight: 800; line-height: 1.3;
  opacity: 0; transform: scale(.3); transform-origin: 90% 100%;
  pointer-events: none;
}
.bz-bubble::after {
  content: ''; position: absolute; right: 14px; bottom: -10px;
  border: 8px solid transparent; border-top-color: #000; border-bottom: 0;
}
.bz-bubble.show { animation: bz-bubble .3s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes bz-bubble { to { opacity: 1; transform: scale(1); } }
.bz.rage .bz-bubble { background: #ffe3e3; color: #c92a2a; }

/* ---- Hiệu ứng ---- */
.bz-fx { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.bz-p { position: absolute; transform: translate(-50%, -50%); will-change: transform, opacity, left, top; }
.bz-proj { font-size: 34px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.bz-proj.fist { font-size: 44px; }
.bz-boom { font-size: 52px; }
.bz-boom.big { font-size: 64px; }
.bz-spark { font-size: 18px; }
.bz-num {
  font-size: 30px; font-weight: 900; color: #fff; white-space: nowrap; text-align: center; line-height: 1;
  -webkit-text-stroke: 2px #000; paint-order: stroke fill;
  text-shadow: 0 3px 0 #000;
}
.bz-num small { display: block; font-size: 14px; -webkit-text-stroke: 1px #000; color: #ffe066; }
.bz-num.crit { color: #ffd43b; font-size: 40px; }
.bz-num.miss { color: #ced4da; font-size: 24px; }
.bz-num.ouch { color: #ff6b6b; font-size: 26px; }
.bz-num.rage { color: #ff6b6b; font-size: 26px; }

.bz-combo {
  position: absolute; left: 50%; top: 10px; z-index: 5;
  transform: translateX(-50%) scale(0);
  font-weight: 900; color: #fff; font-size: 18px; white-space: nowrap;
  padding: 3px 14px; border-radius: 99px; border: 2.5px solid #000;
  background: linear-gradient(90deg, #f76707, #fab005);
  text-shadow: 0 2px 0 #000;
  box-shadow: 0 3px 0 #000;
  pointer-events: none;
}
.bz-combo b { font-size: 24px; }
.bz-combo small { font-size: 12px; color: #fff3bf; }
.bz-combo[data-tier="2"] { background: linear-gradient(90deg, #e03131, #f76707); }
.bz-combo[data-tier="3"] { background: linear-gradient(90deg, #7048e8, #e64980, #f76707); animation: bz-rainbow 1s linear infinite; }
@keyframes bz-rainbow { to { filter: hue-rotate(360deg); } }
.bz-combo.pop { animation: bz-combo-pop .35s cubic-bezier(.2, 1.8, .4, 1) forwards; }
.bz-combo[data-tier="3"].pop { animation: bz-combo-pop .35s cubic-bezier(.2, 1.8, .4, 1) forwards, bz-rainbow 1s linear infinite; }
@keyframes bz-combo-pop { 0% { transform: translateX(-50%) scale(1.8) rotate(-8deg); } 100% { transform: translateX(-50%) scale(1) rotate(0); } }

.bz-flash { position: absolute; inset: 0; pointer-events: none; z-index: 6; opacity: 0; }
.bz-flash.white { background: #fff; animation: bz-flash .26s ease-out; }
.bz-flash.red { background: radial-gradient(ellipse at center, transparent 40%, rgba(224, 49, 49, .75)); animation: bz-flash .45s ease-out; }
.bz-flash.gold { background: radial-gradient(circle at 70% 60%, rgba(255, 224, 102, .9), transparent 70%); animation: bz-flash .7s ease-out; }
@keyframes bz-flash { 0% { opacity: .85; } 100% { opacity: 0; } }
.bz.shake .bz-scene { animation: bz-shake .42s linear; }
@keyframes bz-shake {
  0%, 100% { transform: none; }
  15% { transform: translate(-7px, 3px); } 30% { transform: translate(6px, -4px); }
  45% { transform: translate(-5px, -2px); } 60% { transform: translate(4px, 3px); } 80% { transform: translate(-2px, 1px); }
}

/* Bảng chiến thắng */
.bz-win {
  position: absolute; inset: 0; z-index: 7;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .45);
}
.bz-win.show .bz-win-card { animation: bz-win-in .55s cubic-bezier(.2, 1.5, .4, 1) .45s both; }
.bz-win-card {
  text-align: center; color: #2b1d14;
  padding: 14px 22px; border-radius: 18px;
  background: linear-gradient(180deg, #fff9db, #ffe066);
  border: 3px solid #000; box-shadow: 0 5px 0 #000;
  max-width: 90%;
}
@keyframes bz-win-in { 0% { transform: scale(.2) rotate(-12deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.bz-win-title { font-size: 30px; font-weight: 900; color: #e8590c; text-shadow: 0 2px 0 #fff, 0 4px 0 rgba(0, 0, 0, .2); }
.bz-win-sub { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.bz-win-rw { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bz-win-rw span { background: #fff; border: 2px solid #000; border-radius: 99px; padding: 3px 10px; font-weight: 900; font-size: 13px; }
.bz-win-next { margin-top: 8px; font-size: 12px; font-style: italic; color: #862e9c; }

/* ---- Bảng điều khiển ---- */
.bz-controls {
  padding: 12px 14px 14px;
  background: #fffdf6;
  border-top: 2.5px solid var(--outline);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
}
.bz-me-bar { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 420px; font-size: 12.5px; font-weight: 800; }
.bz-en { flex: 1; height: 12px; border-radius: 99px; background: #e9ecef; border: 2px solid #000; overflow: hidden; }
.bz-en i { display: block; height: 100%; background: linear-gradient(90deg, #40c057, #94d82d); transition: width .3s; }
.bz-attack {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 26px 10px 14px;
  font: inherit; color: #fff; cursor: pointer;
  border: 3px solid #000; border-radius: 18px;
  background: linear-gradient(180deg, #ff6b6b, #e03131 60%, #c92a2a);
  box-shadow: 0 6px 0 #000, 0 10px 22px rgba(224, 49, 49, .45);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .4);
  transition: transform .08s, box-shadow .08s, filter .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.bz-attack:hover { filter: brightness(1.08); }
.bz-attack:active, .bz-attack.punch { transform: translateY(5px); box-shadow: 0 1px 0 #000, 0 4px 10px rgba(224, 49, 49, .4); }
.bz-attack.tired { filter: grayscale(.8); }
.bz-attack.nope { animation: bz-nope .4s; }
@keyframes bz-nope { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.bz-fist { font-size: 34px; display: inline-block; text-shadow: none; }
.bz-attack.punch .bz-fist { animation: bz-fist .25s ease-out; }
@keyframes bz-fist { 40% { transform: scale(1.4) rotate(-20deg) translateX(8px); } }
.bz-at-text { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.bz-at-text b { font-size: 22px; font-weight: 900; letter-spacing: 1px; }
.bz-at-text small { font-size: 11px; opacity: .9; }
.bz-info { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12.5px; }
.bz-tips { font-size: 11.5px; color: #868e96; text-align: center; max-width: 620px; line-height: 1.4; }
.bz-tips kbd { font: inherit; font-weight: 800; padding: 0 5px; border: 1px solid #adb5bd; border-radius: 4px; background: #fff; }

/* ---- Điện thoại ---- */
@media (max-width: 760px), (max-height: 500px) {
  .bz-scene { height: 240px; }
  .bz-player { width: 92px; height: 120px; left: 4%; }
  .bz-boss { right: 2%; scale: .82; transform-origin: bottom right; }
  .bz-window { width: 110px; height: 64px; }
  .bz-sign { top: 94px; font-size: 10.5px; }
  .bz-table { display: none; }
  .bz-bubble { max-width: 150px; font-size: 11.5px; }
  .bz-attack { width: 100%; justify-content: center; }
  .bz-tips { display: none; }
}
@media (max-height: 500px) {
  .bz-scene { height: 200px; }
  .bz-boss { scale: .7; }
}

@media (prefers-reduced-motion: reduce) {
  .bz *, .bz *::before, .bz *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---- Kiệt sức / boss hồi máu ---- */
.bz-heal-tag {
  display: none;
  font-size: 11px; font-weight: 900;
  padding: 2px 8px; border-radius: 99px;
  background: #2f9e44; border: 2px solid #000;
  animation: bz-blink 1s steps(2) infinite;
}
.bz.healing .bz-heal-tag { display: inline-block; }
.bz.healing .bz-hp-fill { box-shadow: 0 0 12px 2px rgba(64, 192, 87, .9); }
.bz-en { position: relative; }
.bz-en u {
  position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px;
  background: #e03131; border-radius: 2px; display: none;
}
.bz.exhausted .bz-en i { background: linear-gradient(90deg, #fa5252, #ff922b); }
.bz.exhausted .bz-player { filter: grayscale(.45); }
.bz-player.dizzy { animation: bz-dizzy .9s ease-in-out; }
@keyframes bz-dizzy { 0%, 100% { transform: none; } 25% { transform: rotate(-7deg); } 50% { transform: rotate(6deg); } 75% { transform: rotate(-4deg); } }
.bz-num.tired { color: #adb5bd; font-size: 22px; }
.bz-attack.tired { filter: grayscale(.85); cursor: not-allowed; }
