@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;600;700;900&display=swap');

/* ================= تنظیمات پایه ================= */
#tab-hokm-game {
    background: radial-gradient(circle at top, #161922 0%, #08090c 100%);
    color: #e2e8f0;
    overflow: hidden;
    margin: 0;
    padding-bottom: env(safe-area-inset-bottom);
}

#tab-hokm-game div,
#tab-hokm-game span,
#tab-hokm-game h1,
#tab-hokm-game h2,
#tab-hokm-game h3,
#tab-hokm-game p,
#tab-hokm-game button,
#tab-hokm-game input {
    font-family: 'Vazirmatn', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

#tab-hokm-game i {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

/* ================= استایل‌های شیشه‌ای و میز ================= */
.glass-luxury {
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 215, 0, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.casino-table-wrapper {
    perspective: 1000px;
}

.casino-table {
    background: radial-gradient(ellipse at center, #0d7a42 0%, #053b1e 100%);
    border: 16px solid #4a2c11;
    border-radius: 140px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 4px #2a1608;
    position: relative;
}

.casino-table::after {
    content: '';
    position: absolute;
    top: 20px; left: 30px; right: 30px; bottom: 20px;
    border: 2px solid rgba(212, 175, 55, 0.4);
    border-radius: 120px;
    pointer-events: none;
}

/* ================= کارت‌های دست بازیکن (Player Hand) ================= */
#playerHand {
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 95px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
    overflow: visible;
    z-index: 50;
}

.poker-card {
    position: absolute;
    bottom: 0;
    left: calc(50% - 26px);
    width: 52px;
    height: 80px;
    background: #ffffff;
    background-image: linear-gradient(135deg, #ffffff 65%, #f4f4f5 100%);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    box-shadow: -2px 3px 8px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3px;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    font-family: Arial, Helvetica, sans-serif;
    transition: bottom 0.2s cubic-bezier(0.2, 0.8, 0.2, 1.1), box-shadow 0.2s ease, border-color 0.2s ease;
    will-change: bottom;
}

.poker-card:hover {
    bottom: 20px !important;
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.7) !important;
    border-color: #ffd700 !important;
    z-index: 100 !important;
}

/* ================= کارت‌های وسط میز ================= */
.table-card {
    position: absolute;
    width: 52px;
    height: 76px;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3px;
    transition: all 0.3s ease-out;
    pointer-events: none;
}

/* پشت کارت در حالت انتظار */
.deck-placeholder {
    width: 62px;
    height: 92px;
    background: repeating-linear-gradient(45deg, #18181b, #18181b 10px, #27272a 10px, #27272a 20px);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    position: absolute;
    transform: rotate(-12deg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.deck-placeholder::after {
    content: '👑';
    font-size: 32px;
    opacity: 0.45;
}

/* ================= کارت‌های پشت‌رو حریفان و یار (Facedown Hands) ================= */
.mini-card-back {
    width: 20px;
    height: 30px;
    background: repeating-linear-gradient(45deg, #1e293b, #1e293b 4px, #0f172a 4px, #0f172a 8px);
    border: 1px solid rgba(255, 215, 0, 0.45);
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
}

/* کارت‌های افقی یار بالا با همپوشانی بادبزنی */
.opponent-hand-h {
    display: flex;
    justify-content: center;
    align-items: center;
}
.opponent-hand-h .mini-card-back {
    margin-left: -13px;
}
.opponent-hand-h .mini-card-back:first-child {
    margin-left: 0;
}

/* کارت‌های عمودی حریفان راست و چپ با همپوشانی */
.opponent-hand-v {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.opponent-hand-v .mini-card-back {
    margin-top: -22px;
}
.opponent-hand-v .mini-card-back:first-child {
    margin-top: 0;
}

/* ================= صندلی‌ها و آواتارها ================= */
.player-seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 20;
    transition: transform 0.3s ease;
}

.avatar-frame {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    background: #111;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    position: relative;
}

.turn-active .avatar-frame {
    border-color: #38bdf8;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.6);
    transform: scale(1.08);
}

.player-nameplate {
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    margin-top: -8px;
    z-index: 5;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* ================= بج‌ها و تایمر ۶۰ ثانیه‌ای نئونی ================= */
.gift-badge {
    position: absolute;
    bottom: 8px;
    left: -6px;
    background: #e11d48;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    border: 1.5px solid #ffffff;
    z-index: 30;
}

/* تراز متقارن بالای سر کاراکتر */
.level-badge {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 7px;
    border-radius: 10px;
    border: 1.5px solid #ffffff;
    z-index: 40;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

/* خط آبی انیمیشنی ۶۰ ثانیه‌ای */
.timer-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #0284c7);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.85);
    border-radius: 3px;
    transition: width 1s linear, background-color 0.4s ease;
}

.timer-bar.warning {
    background: linear-gradient(90deg, #ef4444, #b91c1c) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.9) !important;
}

/* نوار تایمر شما بالای کارت‌ها */
#myTimerWrapper {
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}

/* دکمه‌های استیکر و واکنش */
.sticker-btn {
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    font-size: 20px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.sticker-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(212, 175, 55, 0.5);
    transform: scale(1.1);
}

/* ================= حباب پیام‌ها (Chat & Reaction) ================= */
.chat-bubble {
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: #ffffff;
    color: #09090b;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 14px 14px 14px 2px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    white-space: nowrap;
    border: 2px solid rgba(212, 175, 55, 0.7);
    pointer-events: none;
}

.chat-bubble.show-bubble {
    animation: popBubble 3.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popBubble {
    0% { transform: translateX(-50%) scale(0) translateY(10px); opacity: 0; }
    10% { transform: translateX(-50%) scale(1.08) translateY(0); opacity: 1; }
    15% { transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
    85% { transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) scale(0) translateY(-15px); opacity: 0; }
}

/* ================= انیمیشن کوبیدن دست ================= */
.animate-smash {
    animation: smashShake 0.4s cubic-bezier(.36, .07, .19, .97) both;
    box-shadow: inset 0 0 50px rgba(220, 38, 38, 0.35) !important;
}

@keyframes smashShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-3px, -2px) rotate(-1deg); }
    20% { transform: translate(4px, 2px) rotate(1deg); }
    40% { transform: translate(-4px, 3px) rotate(-1deg); }
    60% { transform: translate(3px, -2px) rotate(1deg); }
    80% { transform: translate(-2px, 1px) rotate(0deg); }
}

/* ================= کمکی ================= */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.pb-safe { padding-bottom: env(safe-area-inset-bottom, 16px); }