/* ===== Mèo Bom effects layer (#mb-fx, #mb-banner): flying cards, stamps, beams, bursts, confetti,
   bomb scene. Motion is driven by the Web Animations API (transform / opacity only); these rules give
   the shapes. prefers-reduced-motion: the queue plays everything instantly and nothing here moves. ===== */
.mb-fx { position: absolute; inset: 0; pointer-events: none; z-index: 10; overflow: visible; }
.mb-fly, .mb-stamp, .mb-burst, .mb-confetti, .mb-bomb-show, .mb-badge-drop { position: absolute; will-change: transform, opacity; }
.mb-fly { transform: translate(-50%, -50%); perspective: 700px; }
.mb-fly .mb-card { filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .35)); }
/* 3D flip: back face first, rotateY(180deg) on .mb-flip reveals the front */
.mb-flip { position: relative; transform-style: preserve-3d; }
.mb-flip-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mb-flip-face > .mb-card { display: block; }
.mb-flip-front { position: absolute; inset: 0; transform: rotateY(180deg); }

.mb-stamp { padding: 6px 14px; border: 4px solid currentColor; border-radius: 10px; font-size: clamp(18px, 5vw, 28px); font-weight: 900;
    letter-spacing: .04em; white-space: nowrap; background: rgba(255, 248, 236, .92); text-shadow: 0 1px 0 #fff; }
.mb-stamp--nope { color: var(--mb-reaction); }
.mb-stamp--reflect { color: var(--mb-turn); }
.mb-stamp--cancel { color: var(--mb-danger); }

.mb-beam { position: absolute; height: 6px; margin-top: -3px; transform-origin: 0 50%; border-radius: 999px;
    background: linear-gradient(90deg, rgba(179, 72, 10, 0), var(--mb-turn) 30%, #FDBA74); box-shadow: 0 0 12px var(--mb-turn); }
.mb-beam::after { content: ""; position: absolute; right: -10px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-left: 14px solid #FDBA74; }
.mb-beam--reflect { background: linear-gradient(90deg, rgba(106, 52, 181, 0), var(--mb-reaction) 30%, #C4B5FD); box-shadow: 0 0 12px var(--mb-reaction); }
.mb-beam--reflect::after { border-left-color: #C4B5FD; }
.mb-badge-drop { padding: 3px 10px; border-radius: 999px; background: var(--mb-turn); color: #fff; font-weight: 900; font-size: 14px; border: 2px solid var(--mb-ink); white-space: nowrap; }

.mb-burst { width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, #FFF7AE 0, #FB923C 35%, rgba(220, 38, 38, .7) 60%, rgba(220, 38, 38, 0) 72%); }
.mb-confetti { width: 8px; height: 12px; border-radius: 2px; }
.mb-confetti--0 { background: #FACC15; }
.mb-confetti--1 { background: #22C55E; }
.mb-confetti--2 { background: #E86F2C; }
.mb-confetti--3 { background: #6A34B5; }

.mb-dim { position: absolute; inset: 0; border-radius: 24px; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .25), rgba(0, 0, 0, .7)); }
.mb-bomb-show { transform: translate(-50%, -50%); }
.mb-bomb-show .mb-card { box-shadow: 0 0 0 3px #FACC15, 0 0 30px rgba(250, 204, 21, .8); border-radius: 8px; }
/* Fuse spark circling the bomb card (rotate only) */
.mb-fuse-spark { position: absolute; inset: -10px; border-radius: 14px; animation: mb-spin 1.1s linear infinite; }
.mb-fuse-spark::before { content: ""; position: absolute; top: -4px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
    background: #FFF7AE; box-shadow: 0 0 10px 4px #FB923C, 0 0 22px 8px rgba(239, 68, 68, .7); }

/* Particle canvas (MB.Particles) covers the table box */
.mb-particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mb-dim--danger { background: radial-gradient(ellipse at center, rgba(120, 10, 20, .2), rgba(60, 0, 8, .78)); }
.mb-flash { position: absolute; inset: -20px; border-radius: 24px; background: #FFFBEB; }
.mb-shock { position: absolute; width: 80px; height: 80px; border-radius: 50%; border: 6px solid rgba(255, 237, 160, .9);
    box-shadow: 0 0 24px rgba(251, 146, 60, .8), inset 0 0 18px rgba(251, 146, 60, .6); will-change: transform, opacity; }
.mb-beam--fire { height: 8px; margin-top: -4px; background: linear-gradient(90deg, rgba(239, 68, 68, 0), #EF4444 25%, #FB923C 60%, #FDE68A);
    box-shadow: 0 0 14px #FB923C, 0 0 28px rgba(239, 68, 68, .6); }
.mb-beam--fire::after { border-left-color: #FDE68A; }
.mb-float { position: absolute; font-weight: 900; font-size: 20px; color: #FFF8EC; text-shadow: 0 2px 0 var(--mb-ink), 0 0 8px rgba(0, 0, 0, .5);
    white-space: nowrap; will-change: transform, opacity; }
.mb-float--zzz { color: #BFDBFE; font-style: italic; }

/* Wire-cut scissors (two blades closing on a fuse wire) */
.mb-cut { position: absolute; width: 140px; height: 70px; will-change: transform, opacity; }
.mb-cut-wire { position: absolute; top: 31px; height: 7px; width: 70px; border-radius: 4px;
    background: repeating-linear-gradient(90deg, #DC2626 0 8px, #FACC15 8px 16px); border: 2px solid var(--mb-ink); box-sizing: border-box; }
.mb-cut-wire--l { left: 0; transform-origin: 100% 50%; }
.mb-cut-wire--r { right: 0; transform-origin: 0 50%; }
.mb-cut-blade { position: absolute; left: 28px; top: 30px; width: 84px; height: 10px; transform-origin: 64% 50%;
    border-radius: 2px 60% 60% 2px; background: linear-gradient(180deg, #F3F4F6, #9CA3AF); border: 2px solid var(--mb-ink); box-sizing: border-box; }
.mb-cut-blade::before { content: ""; position: absolute; left: -18px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
    border: 4px solid var(--op-accent, #E86F2C); box-sizing: border-box; }

/* Banners ("Lượt của bạn!", "BÙM!", "CHIẾN THẮNG!") */
.mb-banner { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 900; }
.mb-banner-text { grid-area: 1 / 1; padding: 10px 26px; border: 5px solid var(--mb-ink); border-radius: 18px; background: var(--mb-paper); color: var(--mb-ink);
    font-size: clamp(28px, 9vw, 64px); font-weight: 900; letter-spacing: .02em; box-shadow: 0 8px 0 var(--mb-ink); white-space: nowrap; }
.mb-banner--turn { background: #FACC15; }
.mb-banner--boom { background: var(--mb-danger); color: #fff; font-size: clamp(44px, 16vw, 110px); }
.mb-banner--safe { background: var(--mb-rescue); color: #fff; }
.mb-banner--win { background: linear-gradient(135deg, #FDE68A, #F59E0B); }

/* Seat flashes */
.mb-seat.is-danger .mb-seat-initial { animation: mb-heartbeat .5s ease-in-out infinite; box-shadow: 0 0 0 4px var(--mb-danger), 0 0 22px var(--mb-danger); }
.mb-seat.is-cracked .mb-seat-initial { animation: mb-crack .6s ease-out; }
.mb-seat.is-peeking .mb-seat-note::before { content: "Đang soi…"; }
.mb-seat.is-timeout .mb-seat-avatar { animation: mb-nudge .4s ease-in-out 2; }

@keyframes mb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes mb-spin { to { transform: rotate(360deg); } }
@keyframes mb-heartbeat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.15); } 60% { transform: scale(.97); } }
@keyframes mb-crack { 0% { transform: scale(1.3) rotate(-8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes mb-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-5px); } }

@media (prefers-reduced-motion: reduce) {
    .mb-body *, .mb-body *::before, .mb-body *::after { animation: none !important; transition: none !important; }
    .mb-fx, .mb-banner { display: none; }
}
