/* cards.css - Thư viện cardsJS tùy biến chuẩn Sòng Bạc ONLY ZEPHYS */
/* CHẶN HOÀN TOÀN BẢNG CHỨC NĂNG TRÌNH DUYỆT KHI NHẤN GIỮ (IMAGE CALLOUT / CONTEXT MENU) */
img.card,
.player-hand-card,
.hand,
#card-player-hand,
#card-center-played-cards,
#card-game-modal,
#card-game-landscape-box {
	-webkit-touch-callout: none !important;
	-webkit-user-select: none !important;
	-moz-user-select: none !important;
	-ms-user-select: none !important;
	user-select: none !important;
	-webkit-user-drag: none !important;
	touch-action: manipulation !important;
}

img.card {
	width: 58px;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	vertical-align: initial;
	box-sizing: border-box;
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.18s ease;
	border-radius: 6px;
	filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35));
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none !important;
	pointer-events: auto;
	will-change: transform;
}

@media (min-width: 640px) {
	img.card {
		width: 64px;
	}
}

@media (min-width: 768px) {
	img.card {
		width: 70px;
	}
}

/*
 * Cụm bài trên tay: Xếp chồng gối lên nhau (compact horizontal hand)
 * Chỉ lộ mép trái chứa số và chất bài, tiết kiệm tối đa diện tích
 */
.hand {
	padding: 0;
	margin: 0;
}

.active-hand img.card { 
	cursor: pointer;
}

.hhand-compact { 
	display: inline-flex !important;
	align-items: flex-end !important;
	justify-content: center !important;
	position: relative;
	padding-top: 24px;
	padding-bottom: 2px;
}

.hhand-compact img.card:first-child { 
	margin-left: 0px;
}

.hhand-compact img.card { 
	margin-left: -42px;
}

@media (min-width: 640px) {
	.hhand-compact img.card { 
		margin-left: -46px;
	}
}

@media (min-width: 768px) {
	.hhand-compact img.card { 
		margin-left: -50px;
	}
}

/* Xì Dách: bài dãn cách đều, rộng rãi, nhìn rõ ràng từng lá */
.xi-dach-hand {
	display: inline-flex !important;
	align-items: flex-end !important;
	justify-content: center !important;
	gap: 8px !important;
	padding-top: 20px;
	padding-bottom: 2px;
}

.xi-dach-hand img.card {
	margin-left: 0 !important;
	width: 64px !important;
}

@media (min-width: 640px) {
	.xi-dach-hand {
		gap: 12px !important;
	}
	.xi-dach-hand img.card {
		width: 74px !important;
	}
}

/* Hover nhô nhẹ bài lên */
.hhand-compact.active-hand img.card:hover { 
	transform: translateY(-8px);
}

/* Khi người chơi nhấp chọn bài: Đưa lên cao 20px + Hào quang viền vàng */
.hhand-compact img.card.selected { 
	transform: translateY(-20px) !important;
	filter: drop-shadow(0 0 14px rgba(250, 204, 21, 0.95)) brightness(1.08) !important;
	z-index: 80 !important;
	position: relative;
}

/* Bài dạng xòe thường (khi cần) */
.hhand {
	display: inline-flex;
	gap: 4px;
}

.hhand img.card { 
	padding-top: 10px;
}

.hhand.active-hand img.card:hover { 
	transform: translateY(-8px);
}

/* ==========================================================================
   HIỆU ỨNG CHIẾN THẮNG & CHIA TIỀN (WINNER AURA & CHIP DISTRIBUTION)
   ========================================================================== */

/* Hào quang vàng kim quanh ghế người thắng */
.card-winner-aura {
    position: absolute;
    inset: -10px;
    border-radius: 9999px;
    border: 3px solid #facc15;
    box-shadow: 0 0 25px rgba(250, 204, 21, 0.95), inset 0 0 15px rgba(250, 204, 21, 0.5);
    animation: pulseAura 0.9s infinite alternate ease-in-out;
    pointer-events: none;
    z-index: 35;
}

@keyframes pulseAura {
    from {
        transform: scale(0.96);
        box-shadow: 0 0 15px rgba(250, 204, 21, 0.7);
    }
    to {
        transform: scale(1.08);
        box-shadow: 0 0 35px rgba(250, 204, 21, 1), 0 0 50px rgba(234, 179, 8, 0.8);
    }
}

/* Vương miện nảy trên đầu người thắng */
.card-winner-crown {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    animation: bounceCrown 0.8s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 12px rgba(250, 204, 21, 1));
    z-index: 40;
    pointer-events: none;
}

@keyframes bounceCrown {
    0% { transform: translateX(-50%) translateY(0) scale(1); }
    100% { transform: translateX(-50%) translateY(-8px) scale(1.15); }
}

/* Đồng chip / xu vàng bay từ người thua về người thắng */
.card-flying-chip {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(circle, #fde047 30%, #eab308 70%, #ca8a04 100%);
    border: 2px dashed #fef08a;
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.95), inset 0 0 4px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    color: #78350f;
    pointer-events: none;
    z-index: 55;
    will-change: transform, left, top;
}

/* Floating number tiền cược bay lên (+30 OG / -10 OG) */
.card-floating-score {
    position: absolute;
    font-family: 'Be Vietnam Pro', monospace;
    font-weight: 900;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 60;
    animation: floatScoreUp 1.6s ease-out forwards;
}

.card-floating-score.plus {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.9), 0 2px 4px #000;
}

.card-floating-score.minus {
    color: #f87171;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.8), 0 2px 4px #000;
}

@keyframes floatScoreUp {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.6);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -10px) scale(1.15);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -35px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50px) scale(0.9);
    }
}

/* Hạt confetti pháo hoa */
.card-confetti-particle {
    position: absolute;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 50;
    animation: fallConfetti var(--duration, 2s) ease-out forwards;
}

@keyframes fallConfetti {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx, 0px), var(--ty, 200px)) rotate(var(--rot, 720deg)) scale(0.5);
    }
}

