/* استودیوی منچ با زبان طراحی یکپارچه کوییزبی (Light/Dark Surface Tokens) */
.mench-studio {
    --felt: #f8fafc;
    --rim: #cbd5e1;
    --tile: #ffffff;
    --ink: #0f172a;
    position: relative;
    border-radius: var(--qb-radius-3xl, 24px);
    padding: clamp(16px, 3vw, 32px);
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    color: var(--ink);
    overflow: hidden;
    transition: background 0.25s, border-color 0.25s;
}

/* حالت تاریک سازگار با تم شب */
html.dark .mench-studio,
.dark .mench-studio {
    --felt: #0f172a;
    --rim: #334155;
    --tile: #1e293b;
    --ink: #f8fafc;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(51, 65, 85, 0.8);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

/* تم‌های بصری صفحه بازی منچ */
.mench-studio[data-theme=classic] { --rim: #d97706; }
.mench-studio[data-theme=royal] { --rim: #6366f1; }
.mench-studio[data-theme=neon] { --rim: #a855f7; }
.mench-studio[data-theme=wood] { --rim: #b45309; }
.mench-studio[data-theme=pearl] { --rim: #64748b; }

.mench-studio .qb-text-head { color: #0f172a; }
.mench-studio .qb-text-muted { color: #64748b; }
html.dark .mench-studio .qb-text-head, .dark .mench-studio .qb-text-head { color: #f8fafc; }
html.dark .mench-studio .qb-text-muted, .dark .mench-studio .qb-text-muted { color: #94a3b8; }

.mench-eyebrow {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: #4f46e5;
    font-weight: 900;
}
html.dark .mench-eyebrow, .dark .mench-eyebrow {
    color: #818cf8;
}

.mench-themes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0;
    width: 100%;
    box-sizing: border-box;
}
.mench-themes.mench-themes-sidebar,
.mench-themes-2col {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
@media (max-width: 640px) {
    .mench-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mench-themes button {
    border: 1px solid var(--qb-border-color, #e2e8f0);
    border-radius: 12px;
    padding: 8px 10px;
    background: #f8fafc;
    color: #334155;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: all 0.15s;
}
html.dark .mench-themes button, .dark .mench-themes button {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(51, 65, 85, 0.8);
    color: #e2e8f0;
}
.mench-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--dot, #dab577);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}
html.dark .mench-dot, .dark .mench-dot {
    border-color: #1e293b;
}
.mench-themes button.is-picked { animation: mench-pick .35s ease; }
@keyframes mench-pick { 0% { transform: scale(1); } 40% { transform: scale(.9); } 100% { transform: scale(1); } }
.mench-themes button[aria-pressed=true] {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    box-shadow: inset 0 0 0 1px #6366f1;
}
html.dark .mench-themes button[aria-pressed=true], .dark .mench-themes button[aria-pressed=true] {
    border-color: #818cf8;
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
}
.mench-themes button:focus-visible, .mench-studio button:focus-visible { outline: 3px solid #818cf8; outline-offset: 3px; }

/* قاب و حاشیه تخته منچ */
.mench-board-wrap {
    max-width: 580px;
    margin: auto;
    padding: 10px;
    border-radius: 24px;
    background: #f1f5f9;
    border: 1.5px solid var(--rim, #e2e8f0);
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.08);
}
html.dark .mench-board-wrap, .dark .mench-board-wrap {
    background: rgba(30, 41, 59, 0.7);
    border-color: var(--rim, #475569);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}
#mench-board {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    touch-action: manipulation;
    cursor: pointer;
}

/* بهینه‌سازی اختصاصی استودیو و تخته منچ برای لپ‌تاپ‌ها (۱۰۲۴ تا ۱۴۴۰ پیکسل) */
@media (min-width: 1024px) and (max-width: 1440px) {
    .mench-studio {
        padding: 1rem 1.15rem;
    }
    .mench-board-wrap {
        max-width: min(480px, calc(100vh - 300px));
        padding: 8px;
    }
    #mench-seats {
        margin: 8px auto !important;
        gap: 6px !important;
    }
    .mench-player {
        padding: 6px 8px !important;
        border-radius: 12px !important;
        gap: 6px !important;
    }
    .mench-player img {
        width: 32px !important;
        height: 32px !important;
    }
    .mench-player strong {
        font-size: 11px !important;
    }
    .mench-command-deck {
        margin-top: 8px !important;
        padding: 8px 12px !important;
    }
    #mench-dice {
        width: 76px !important;
        height: 76px !important;
    }
    .mench-dice-tray {
        margin: 2px auto 8px !important;
    }
}

/* کارت‌های وضعیت بازیکنان */
#mench-seats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px auto;
    max-width: 620px;
}
.mench-player {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    min-width: 0;
    transition: all 0.2s;
}
html.dark .mench-player, .dark .mench-player {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(51, 65, 85, 0.8);
    color: #f8fafc;
}
.mench-player[data-active=true] {
    border-color: var(--player);
    box-shadow: inset 3px 0 0 var(--player), 0 0 0 2px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(0, 0, 0, 0.05);
    background: #ffffff;
}
html.dark .mench-player[data-active=true], .dark .mench-player[data-active=true] {
    background: rgba(30, 41, 59, 0.95);
    box-shadow: inset 3px 0 0 var(--player), 0 0 0 2px rgba(99, 102, 241, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
}
.mench-player img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--player);
    background: #fff;
    flex-shrink: 0;
}
.mench-player strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 900;
    color: #0f172a;
}
html.dark .mench-player strong, .dark .mench-player strong { color: #f8fafc; }
.mench-player small {
    font-size: 10px;
    color: #64748b;
    display: block;
    font-weight: 700;
}
html.dark .mench-player small, .dark .mench-player small { color: #94a3b8; }
.mench-player-copy { min-width: 0; flex: 1; }
.mench-player-progress { display: flex; gap: 3px; margin-top: 5px; }
.mench-player-progress i {
    width: 16px;
    height: 3.5px;
    border-radius: 4px;
    background: #cbd5e1;
}
html.dark .mench-player-progress i, .dark .mench-player-progress i { background: #475569; }
.mench-player-progress i[data-home=true] { background: var(--player); }

/* نوار نوبت بازی */
#mench-turn {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border: 1.5px solid #c7d2fe;
    color: #3730a3;
    border-radius: 9999px;
    min-height: 38px;
    max-width: 340px;
    width: fit-content;
    min-width: 220px;
    margin: 0 auto 12px;
    padding: 6px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.5;
    font-weight: 900;
    font-size: 13.5px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}
html.dark #mench-turn, .dark #mench-turn {
    background: linear-gradient(135deg, rgba(49, 46, 129, 0.4), rgba(76, 29, 149, 0.4));
    border-color: rgba(99, 102, 241, 0.5);
    color: #e0e7ff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.mench-dice-tray {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin: 4px auto 14px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}
#mench-dice {
    width: 96px;
    height: 96px;
    filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.22));
    border-radius: 22px;
    background: transparent;
    transition: transform 0.18s ease;
}
#mench-dice.is-rolling { animation: mench-tumble .44s linear infinite; }
@keyframes mench-tumble {
    0% { transform: translateY(0) rotate(0) scale(.92); }
    25% { transform: translateY(-16px) rotate(95deg) scale(1.08); }
    75% { transform: translateY(-6px) rotate(275deg) scale(.96); }
    100% { transform: translateY(0) rotate(360deg) scale(.92); }
}
.mench-token-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 4px;
    margin-top: 8px;
}
.mench-token-actions button {
    font: inherit;
    font-weight: 900;
    font-size: 12px;
    padding: 10px 16px;
    border: 2px solid #fbbf24;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.25));
    color: var(--ink);
    cursor: pointer;
    min-height: 44px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
    animation: mench-btn-pulse 1.1s ease-in-out infinite alternate;
    transition: transform .15s;
}
.mench-token-actions button:hover { transform: translateY(-2px) scale(1.03); }
@keyframes mench-btn-pulse {
    from { box-shadow: 0 0 8px rgba(251, 191, 36, 0.35); }
    to { box-shadow: 0 0 18px rgba(251, 191, 36, 0.75); }
}
.mench-celebration { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 55; }
.mench-celebration i {
    position: absolute;
    width: var(--w, 8px);
    height: var(--h, 16px);
    border-radius: var(--r, 3px);
    background: var(--confetti);
    left: var(--x);
    top: -24px;
    animation: mench-confetti var(--dur, 2.3s) var(--delay, 0s) cubic-bezier(.22, .61, .36, 1) forwards;
}
@keyframes mench-confetti {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
    75% { opacity: 1; }
    100% { transform: translate3d(var(--drift, 20px), 860px, 0) rotate(760deg); opacity: 0; }
}
.mench-meta { font-size: 11px; text-align: center; color: #64748b; margin-top: 12px; font-weight: 700; }
html.dark .mench-meta, .dark .mench-meta { color: #94a3b8; }
@media (max-width: 480px) {
    .mench-studio { padding: 14px; }
    .mench-board-wrap { padding: 6px; }
    .mench-player { padding: 7px; gap: 6px; }
    .mench-player img { width: 34px; height: 34px; }
    .mench-player strong { font-size: 11px; }
    .mench-themes button { padding: 8px 10px; }
}
@media(max-width:480px){.mench-studio{padding:14px}.mench-board-wrap{padding:7px}.mench-player{padding:7px;gap:6px}.mench-player img{width:34px;height:34px}.mench-player strong{font-size:11px}.mench-themes button{padding:8px 10px}}
@media(prefers-reduced-motion:reduce){#mench-dice.is-rolling,.mench-celebration i,.mench-themes button.is-picked,.mench-chant-banner{animation:none}*{scroll-behavior:auto!important}}

/* ========================================================
   کنسول فرمان بازی منچ (Ludo VIP Command Deck)
   ======================================================== */
.mench-command-deck {
    position: relative;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
    background: radial-gradient(ellipse at 50% 0%, #064e3b 0%, #022c22 65%, #011710 100%);
    border: 1.5px solid rgba(52, 211, 153, 0.38);
    border-radius: 22px;
    padding: 14px 16px 12px;
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.55), 0 0 20px rgba(16, 185, 129, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
}
html:not(.dark) .mench-command-deck {
    background: radial-gradient(ellipse at 50% 0%, #f0fdf4 0%, #ecfdf5 55%, #d1fae5 100%);
    border-color: rgba(5, 150, 105, 0.4);
    box-shadow: 0 14px 34px -10px rgba(5, 150, 105, 0.22), 0 0 18px rgba(16, 185, 129, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.mench-deck-glow {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 120px;
    background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.22) 0%, transparent 72%);
    pointer-events: none;
    z-index: 0;
}

/* ۱. بنر وضعیت نوبت بازی */
.mench-msg-banner {
    width: fit-content;
    max-width: 88%;
    margin: 0 auto;
    box-sizing: border-box;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 9999px;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    position: relative;
    z-index: 1;
}
html:not(.dark) .mench-msg-banner {
    background: rgba(254, 243, 199, 0.7);
    border-color: rgba(245, 158, 11, 0.35);
}
.mench-status-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: menchStatusPulse 1.8s ease-in-out infinite alternate;
    flex-shrink: 0;
}
@keyframes menchStatusPulse {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.35; transform: scale(0.85); }
}
.mench-msg-text {
    font-size: 11.5px;
    font-weight: 800;
    color: #6ee7b7;
    line-height: 1.35;
    letter-spacing: -0.2px;
}
html:not(.dark) .mench-msg-text {
    color: #b45309;
}

/* ۲. استیج سه‌بعدی و شناور تاس منچ (کاملاً در مرکز) */
.mench-dice-stage,
.mench-dice-tray {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 2px 0 4px;
    position: relative;
    z-index: 2;
    gap: 0;
}
.mench-dice-pedestal-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 800px;
    flex-shrink: 0;
}
.mench-dice-pedestal {
    position: relative;
    padding: 6px;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
    border: 1.5px solid rgba(52, 211, 153, 0.5);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: diceFloat 3.4s ease-in-out infinite alternate;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
@keyframes diceFloat {
    0% { transform: translateY(0px) rotate(-1.5deg); }
    100% { transform: translateY(-6px) rotate(1.5deg); }
}
.mench-dice-glow-ring {
    position: absolute;
    inset: -5px;
    border-radius: 28px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, transparent 72%);
    filter: blur(7px);
    pointer-events: none;
    animation: ringPulse 2.6s ease-in-out infinite;
}
@keyframes ringPulse {
    0%, 100% { opacity: 0.45; transform: scale(0.97); }
    50% { opacity: 0.95; transform: scale(1.05); }
}
.mench-dice-canvas,
.mench-chant-dice-canvas,
#mench-dice,
#mench-chant-dice {
    display: none !important;
}
.mench-dice-shadow {
    width: 68px;
    height: 8px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, transparent 70%);
    margin-top: 5px;
    border-radius: 50%;
    animation: shadowScale 3.4s ease-in-out infinite alternate;
}
@keyframes shadowScale {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(0.75); opacity: 0.2; }
}

/* =========================================================================
   تاس سه‌بعدی واقع‌گرایانه و لوکس منچ نخبگان (برگرفته از مار و پله)
   ========================================================================= */
.mench-3d-die {
    position: relative;
    width: 86px;
    height: 86px;
    display: block;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.15s ease;
}
.mench-3d-die:hover {
    transform: scale(1.06);
}
.mench-3d-die:active {
    transform: scale(0.96);
}
.mench-3d-die.rolling {
    animation: none !important;
}
.mench-3d-die .dice-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    perspective: 520px;
}
.mench-3d-die .dice-shadow {
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 58px;
    height: 14px;
    margin-left: -29px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 70%);
    opacity: 0.45;
}
.mench-3d-die .dice-hop {
    position: relative;
    width: 58px;
    height: 58px;
    transform-style: preserve-3d;
    margin-top: -6px;
}
.mench-3d-die .dice-cube {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(-28deg);
    transition: transform 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.mench-3d-die .dice-face {
    position: absolute;
    inset: 0;
    border-radius: 11px;
    overflow: hidden;
    background: linear-gradient(145deg, #fffdf6 0%, #faf3e3 45%, #e3d5b8 80%, #c9b891 100%);
    box-shadow: inset 0 0 0 1.5px rgba(120, 100, 60, 0.55), inset 0 -7px 13px rgba(101, 84, 45, 0.35), inset 0 4px 7px rgba(255, 255, 255, 0.95), 0 3px 7px rgba(0, 0, 0, 0.3);
    backface-visibility: hidden;
}
.mench-3d-die .dice-face::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.08) 38%, transparent 55%);
    pointer-events: none;
}
.mench-3d-die .dice-face svg {
    width: 100%;
    height: 100%;
    display: block;
}
.mench-3d-die .df-1 { transform: translateZ(29px); }
.mench-3d-die .df-6 { transform: rotateY(180deg) translateZ(29px); }
.mench-3d-die .df-2 { transform: rotateY(90deg) translateZ(29px); }
.mench-3d-die .df-5 { transform: rotateY(-90deg) translateZ(29px); }
.mench-3d-die .df-3 { transform: rotateX(90deg) translateZ(29px); }
.mench-3d-die .df-4 { transform: rotateX(-90deg) translateZ(29px); }

.mench-3d-die.is-six::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 3.5px solid #fbbf24;
    pointer-events: none;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.8);
    animation: menchRingOut 1.1s ease-out forwards;
}
@keyframes menchRingOut {
    from { transform: scale(0.6); opacity: 1; }
    to { transform: scale(1.6); opacity: 0; }
}

/* ۳. دکمه بزرگ و سه‌بعدی پرتاب تاس (تمام‌عرض) */
.mench-grand-roll-btn {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 55%, #047857 100%);
    border: 0;
    border-bottom: 3.5px solid #065f46;
    color: #ffffff;
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 6px 18px -2px rgba(5, 150, 105, 0.55), 0 0 14px rgba(16, 185, 129, 0.35);
    overflow: hidden;
    transition: all 0.12s ease;
    outline: none;
    letter-spacing: -0.2px;
    z-index: 1;
}
.mench-grand-roll-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -2px rgba(5, 150, 105, 0.65), 0 0 20px rgba(16, 185, 129, 0.5);
    filter: brightness(1.06);
}
.mench-grand-roll-btn:active:not(:disabled) {
    transform: translateY(2px);
    border-bottom-width: 1.5px;
    box-shadow: 0 3px 8px rgba(5, 150, 105, 0.45);
}
.mench-grand-roll-btn:disabled {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.55) 0%, rgba(30, 41, 59, 0.65) 100%);
    border-bottom: 2px solid rgba(15, 23, 42, 0.8);
    color: rgba(148, 163, 184, 0.6);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.65;
    filter: none;
    transform: none !important;
}
html:not(.dark) .mench-grand-roll-btn:disabled {
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.9) 0%, rgba(203, 213, 225, 0.9) 100%);
    border-bottom: 2px solid #cbd5e1;
    color: #94a3b8;
}

/* ۴. استودیو نیت و ذکر شانس تاس (کارت لوکس کامپکت) */
.mench-chant-control {
    width: 100%;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 14px;
    padding: 8px 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}
html:not(.dark) .mench-chant-control {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
}
.mench-chant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 0 1px;
}
.mench-chant-title {
    font-size: 11px;
    font-weight: 800;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 4px;
}
html:not(.dark) .mench-chant-title {
    color: #b45309;
}
.mench-chant-badge {
    font-size: 9px;
    font-weight: 800;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1px 6px;
    border-radius: 12px;
    letter-spacing: -0.2px;
}
.mench-chant-input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    padding: 4px 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
}
html:not(.dark) .mench-chant-input-wrapper {
    background: #ffffff;
    border-color: rgba(203, 213, 225, 0.9);
}
.mench-chant-input-wrapper:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2.5px rgba(245, 158, 11, 0.22);
}
.mench-chant-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    color: #fef08a;
    font-size: 11.5px;
    font-weight: 800;
    font-family: inherit;
    outline: none;
    text-align: right;
    direction: rtl;
}
html:not(.dark) .mench-chant-input {
    color: #1e293b;
}
.mench-chant-input::placeholder {
    color: rgba(254, 240, 138, 0.45);
}
html:not(.dark) .mench-chant-input::placeholder {
    color: #94a3b8;
}
.mench-chant-reset-btn {
    background: transparent;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    padding: 1px 4px;
    border-radius: 6px;
    transition: all 0.2s;
}
.mench-chant-reset-btn:hover {
    color: #f59e0b;
    transform: rotate(180deg);
}
.mench-quick-chants {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
}
.mench-qchant {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex: 0 1 auto;
    box-sizing: border-box;
}
html:not(.dark) .mench-qchant {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(203, 213, 225, 0.85);
    color: #475569;
}
.mench-qchant:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #fde047;
    transform: translateY(-1px);
}
html:not(.dark) .mench-qchant:hover {
    color: #b45309;
}
.mench-qchant.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #fde047;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}
.mench-roll-btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.mench-roll-icon {
    font-size: 19px;
    animation: diceBob 2s ease-in-out infinite;
}
@keyframes diceBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px) rotate(10deg); }
}
.mench-roll-btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-25deg);
    animation: btnShimmer 3.2s infinite;
    pointer-events: none;
}
@keyframes btnShimmer {
    0%, 30% { left: -100%; }
    70%, 100% { left: 160%; }
}

/* ۲. تالار حرفه‌ای کل‌کل و کری‌خوانی صوتی */
.mench-banter-arena {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(245, 158, 11, 0.25);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}
.mench-banter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mench-banter-title {
    font-size: 11.5px;
    font-weight: 900;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 4px;
}
html:not(.dark) .mench-banter-title {
    color: #b45309;
}
.mench-sound-indicator {
    display: flex;
    align-items: center;
    gap: 2.5px;
    height: 14px;
}
.mench-sound-bar {
    width: 2.5px;
    height: 100%;
    background: #f59e0b;
    border-radius: 2px;
    animation: soundWave 1.2s ease-in-out infinite alternate;
}
.mench-sound-bar:nth-child(2) { animation-delay: 0.2s; height: 60%; }
.mench-sound-bar:nth-child(3) { animation-delay: 0.4s; height: 85%; }
@keyframes soundWave {
    0% { height: 25%; }
    100% { height: 100%; }
}
.mench-taunts-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.mench-taunt-pill {
    font: inherit;
    font-weight: 900;
    font-size: 11px;
    padding: 7px 13px;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
html:not(.dark) .mench-taunt-pill {
    background: rgba(254, 243, 199, 0.7);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.4);
}
.mench-taunt-pill:hover {
    background: rgba(245, 158, 11, 0.28);
    border-color: #f59e0b;
    color: #ffffff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.32);
}
html:not(.dark) .mench-taunt-pill:hover {
    background: #fef3c7;
    color: #78350f;
}
.mench-taunt-pill:active {
    transform: scale(0.96);
}
.mench-taunt-icon {
    font-size: 13px;
}
.mench-emoji-dock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 6px 12px;
    max-width: fit-content;
    margin: 2px auto 0;
}
html:not(.dark) .mench-emoji-dock {
    background: rgba(241, 245, 249, 0.85);
    border-color: rgba(203, 213, 225, 0.75);
}
.mench-dock-emoji {
    background: transparent;
    border: 0;
    font-size: 21px;
    padding: 3px 6px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.15s;
    line-height: 1;
}
.mench-dock-emoji:hover {
    transform: scale(1.35) translateY(-4px) rotate(-6deg);
    background: rgba(245, 158, 11, 0.22);
}
.mench-dock-emoji:active {
    transform: scale(0.9);
}

/* فید بازخورد کری‌خوانی */
.mench-emote-feed {
    text-align: center;
    font-size: 12.5px;
    font-weight: 900;
    min-height: 24px;
    margin-top: 4px;
    color: #fde047;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}
html:not(.dark) .mench-emote-feed {
    color: #b45309;
    text-shadow: none;
}

/* نوار وضعیت و قوانین */
.mench-meta-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}
html:not(.dark) .mench-meta-bar {
    color: #64748b;
    border-color: rgba(0, 0, 0, 0.06);
}
.mench-meta-dot {
    color: #f59e0b;
    opacity: 0.6;
}

/* بنر و انیمیشن شانس‌خوانی شناور به همه بازیکنان (بالاتر از بورد بازی) */
.mench-chant-banner {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 60;
    pointer-events: none;
    max-width: 95%;
    width: 350px;
    animation: chantPop .35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@media (max-width: 480px) {
    .mench-chant-banner {
        top: -8px;
        width: 310px;
    }
}
@keyframes chantPop {
    0% { transform: translate(-50%, -75%) scale(0.75) rotate(-2deg); opacity: 0; }
    70% { transform: translate(-50%, -100%) scale(1.03) rotate(0.5deg); opacity: 1; }
    100% { transform: translate(-50%, -100%) scale(1) rotate(0deg); opacity: 1; }
}
.mench-chant-banner.is-fading { animation: chantFade .35s ease-out forwards; }
@keyframes chantFade {
    0% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -125%) scale(0.85); opacity: 0; }
}
.mench-chant-content {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96));
    border: 2px solid #f59e0b;
    border-radius: 18px;
    padding: 9px 14px;
    text-align: center;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65), 0 0 22px rgba(245, 158, 11, 0.4);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}
.mench-chant-author-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 16px;
    font-size: 10.5px;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 4px;
}
.mench-chant-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor; }
.mench-chant-tag { font-size: 9px; color: #f59e0b; background: rgba(245, 158, 11, 0.15); padding: 1px 6px; border-radius: 6px; }
.mench-chant-bubble { font-size: 13.5px; font-weight: 900; color: #ffffff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); line-height: 1.35; padding: 2px 4px; }
.mench-quote-open, .mench-quote-close { color: #f59e0b; font-size: 18px; font-weight: 900; }
.mench-chant-dice-stage { display: flex; align-items: center; justify-content: center; margin: 4px auto 2px; }
.mench-chant-dice-stage .die.mench-3d-die { width: 44px; height: 44px; perspective: 320px; }
.mench-chant-dice-stage .die.mench-3d-die .face { width: 44px; height: 44px; font-size: 20px; }
.mench-chant-burst { margin-top: 5px; padding: 4px 10px; border-radius: 10px; background: linear-gradient(135deg, #10b981, #059669); color: #ffffff; font-size: 12px; font-weight: 900; animation: burstGlow .8s infinite alternate; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45); }
@keyframes burstGlow { from { transform: scale(0.96); box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); } to { transform: scale(1.04); box-shadow: 0 0 24px rgba(16, 185, 129, 0.85); } }

/* افکت تپش قلب و دلهره در انتهای مسیر منچ */
.mench-board-wrap.is-tension {
    box-shadow: 0 0 26px rgba(239, 68, 68, 0.45), 0 16px 36px rgba(0, 0, 0, 0.45) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    animation: menchHeartbeatTension 1.2s ease-in-out infinite;
}
@keyframes menchHeartbeatTension {
    0%, 100% { transform: scale(1); box-shadow: 0 0 18px rgba(239, 68, 68, 0.3); }
    14% { transform: scale(1.008); box-shadow: 0 0 30px rgba(239, 68, 68, 0.7); }
    28% { transform: scale(1); box-shadow: 0 0 20px rgba(239, 68, 68, 0.35); }
    42% { transform: scale(1.005); box-shadow: 0 0 26px rgba(239, 68, 68, 0.6); }
}

/* =========================================================================
   جلوه‌های «آبدار» تخته منچ — لرزش ضربه، پیام شناور و قاب عمق‌دار
   ========================================================================= */

/* لرزش کوتاه تخته هنگام زدن مهرهٔ حریف (Screen Shake) */
.mench-board-wrap.is-shaking {
    animation: menchBoardShake 0.46s cubic-bezier(.36, .07, .19, .97) both;
}
@keyframes menchBoardShake {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
    12%  { transform: translate3d(calc(var(--shake-power, 6px) * -1), calc(var(--shake-power, 6px) * 0.4), 0) rotate(-0.45deg); }
    26%  { transform: translate3d(var(--shake-power, 6px), calc(var(--shake-power, 6px) * -0.5), 0) rotate(0.5deg); }
    42%  { transform: translate3d(calc(var(--shake-power, 6px) * -0.7), calc(var(--shake-power, 6px) * 0.3), 0) rotate(-0.3deg); }
    60%  { transform: translate3d(calc(var(--shake-power, 6px) * 0.5), 0, 0) rotate(0.2deg); }
    80%  { transform: translate3d(calc(var(--shake-power, 6px) * -0.22), 0, 0) rotate(-0.08deg); }
    100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

/* پیام شناور روی تخته: «۶!»، «زدیش!»، «خانه!» */
.mench-fx-toast {
    position: absolute;
    left: 50%;
    top: 42%;
    z-index: 60;
    pointer-events: none;
    transform: translate(-50%, -50%);
    padding: 10px 26px;
    border-radius: 9999px;
    font-size: clamp(18px, 4.4vw, 30px);
    font-weight: 900;
    letter-spacing: -0.02em;
    white-space: nowrap;
    color: #fff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(139, 92, 246, 0.95));
    box-shadow: 0 18px 40px -10px rgba(79, 70, 229, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    animation: menchToastPop 1.5s cubic-bezier(.16, 1.15, .3, 1) both;
}
.mench-fx-toast.is-boom {
    background: linear-gradient(135deg, #ef4444, #f97316 60%, #f59e0b);
    box-shadow: 0 18px 44px -10px rgba(239, 68, 68, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transform-origin: 50% 60%;
    animation: menchToastBoom 1.5s cubic-bezier(.16, 1.15, .3, 1) both;
}
.mench-fx-toast.is-gold {
    background: linear-gradient(135deg, #f59e0b, #fbbf24 55%, #fde047);
    color: #422006;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
    box-shadow: 0 18px 44px -10px rgba(245, 158, 11, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    animation: menchToastPop 1.5s cubic-bezier(.16, 1.15, .3, 1) both;
}
@keyframes menchToastPop {
    0%   { opacity: 0; transform: translate(-50%, -30%) scale(0.55) rotate(-6deg); }
    22%  { opacity: 1; transform: translate(-50%, -62%) scale(1.12) rotate(2deg); }
    38%  { transform: translate(-50%, -72%) scale(1) rotate(0deg); }
    70%  { opacity: 1; transform: translate(-50%, -86%) scale(1.02); }
    100% { opacity: 0; transform: translate(-50%, -128%) scale(0.94); }
}
@keyframes menchToastBoom {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-14deg); }
    18%  { opacity: 1; transform: translate(-50%, -56%) scale(1.3) rotate(6deg); }
    32%  { transform: translate(-50%, -60%) scale(0.94) rotate(-3deg); }
    46%  { transform: translate(-50%, -64%) scale(1.04) rotate(1deg); }
    74%  { opacity: 1; transform: translate(-50%, -82%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -120%) scale(1.05); }
}

/* قاب تخته: سایهٔ عمیق‌تر و درخشش ملایم لبه برای حس فیزیکی بودن صفحه */
.mench-board-wrap {
    box-shadow:
        0 26px 54px -18px rgba(15, 23, 42, 0.35),
        0 8px 18px -10px rgba(15, 23, 42, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    transition: box-shadow 0.35s ease;
}
html.dark .mench-board-wrap, .dark .mench-board-wrap {
    box-shadow:
        0 26px 60px -14px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(148, 163, 184, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
@media (prefers-reduced-motion: reduce) {
    .mench-board-wrap.is-shaking { animation: none; }
    .mench-fx-toast { animation-duration: 0.01s; opacity: 0; }
}

/* بنر نوبت: وقتی نوبت خودِ بازیکن است، نبض ملایم و درخشش می‌گیرد */
#mench-turn.is-my-turn {
    animation: menchTurnPulse 1.9s ease-in-out infinite;
}
@keyframes menchTurnPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 10px rgba(99, 102, 241, 0.18); }
    50% { transform: scale(1.022); box-shadow: 0 6px 22px rgba(99, 102, 241, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
    #mench-turn.is-my-turn { animation: none; }
}



/* =========================================================================
   چیدمان تازهٔ میز منچ: هدر فقط کارت بازیکنان، تنظیمات زیر تخته
   ========================================================================= */
#mench-seats.mench-seats-band {
    margin: 2px auto 10px;
}

/* نوار نوبت: باریک‌تر و چسبیده به تخته (بخشی از ناحیهٔ بازی، نه هدر میز) */
#mench-turn {
    min-height: 34px;
    padding: 5px 18px;
    font-size: 13px;
    margin: 0 auto 8px;
    max-width: 100%;
}

/* نوار ابزار و تنظیمات — زیر تخته */
.mench-board-toolbar {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(148, 163, 184, 0.45);
}
html.dark .mench-board-toolbar,
.dark .mench-board-toolbar {
    border-top-color: rgba(148, 163, 184, 0.25);
}
.mench-toolbar-title {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin: 0;
    min-width: 0;
    font-size: 11.5px;
    font-weight: 900;
    color: #475569;
}
html.dark .mench-toolbar-title,
.dark .mench-toolbar-title {
    color: #94a3b8;
}
.mench-toolbar-eyebrow {
    font-size: 9px;
    letter-spacing: 1.1px;
    color: #6366f1;
    font-weight: 900;
}
html.dark .mench-toolbar-eyebrow,
.dark .mench-toolbar-eyebrow {
    color: #818cf8;
}
.mench-toolbar-code {
    font-size: 10px;
    font-weight: 900;
    padding: 1px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    background: rgba(99, 102, 241, 0.14);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.28);
}
html.dark .mench-toolbar-code,
.dark .mench-toolbar-code {
    color: #a5b4fc;
}
.mench-tool-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.mench-tool-btn {
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    padding: 7px 11px;
    border-radius: 11px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(148, 163, 184, 0.10);
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease;
}
html.dark .mench-tool-btn,
.dark .mench-tool-btn {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(148, 163, 184, 0.12);
}
.mench-tool-btn:hover {
    transform: translateY(-1px);
    border-color: #818cf8;
    background: rgba(99, 102, 241, 0.16);
}
.mench-tool-btn:active { transform: scale(0.97); }
.mench-tool-btn:focus-visible { outline: 3px solid #818cf8; outline-offset: 2px; }
.mench-tool-btn.is-danger {
    color: #e11d48;
    border-color: rgba(225, 29, 72, 0.4);
    background: rgba(225, 29, 72, 0.08);
}
html.dark .mench-tool-btn.is-danger,
.dark .mench-tool-btn.is-danger {
    color: #fb7185;
}
@media (max-width: 520px) {
    .mench-board-toolbar { justify-content: center; }
    .mench-toolbar-title { justify-content: center; width: 100%; }
    .mench-tool-actions { justify-content: center; width: 100%; }
    .mench-toolbar-eyebrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .mench-tool-btn { transition: none; }
}

/* =========================================================================
   بازطراحی ۱۴۰۵/۰۷/۲۹ — پنل انتظار میز، کارت میزهای زنده، دکمه پیوستن و سطح چت
   (TS=ts-20261020-mench-lobby-polish)
   ========================================================================= */

/* ── پنل انتظار: «منتظر بازیکن سوم/چهارم…» با نوار پیشرفت و کد میز ── */
.mench-waiting {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 10px;
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.32);
    color: #1e293b;
    text-align: right;
}
html.dark .mench-waiting,
.dark .mench-waiting {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.24), rgba(14, 116, 144, 0.18));
    border-color: rgba(129, 140, 248, 0.42);
    color: #e2e8f0;
}
.mench-waiting-head { display: flex; align-items: center; gap: 10px; }
.mench-waiting-icon { font-size: 21px; line-height: 1; }
.mench-waiting-title { font-size: 13px; font-weight: 900; letter-spacing: -0.2px; }
.mench-waiting-sub { font-size: 10.5px; font-weight: 700; opacity: 0.8; margin-top: 2px; line-height: 1.7; }
.mench-waiting-count {
    margin-inline-start: auto;
    font-size: 12px;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.16);
    color: #4f46e5;
    white-space: nowrap;
}
html.dark .mench-waiting-count,
.dark .mench-waiting-count { background: rgba(129, 140, 248, 0.24); color: #c7d2fe; }
.mench-waiting-track {
    height: 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
    overflow: hidden;
    margin: 10px 0 9px;
}
.mench-waiting-track > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #0ea5e9);
    transition: width 0.45s ease;
}
.mench-waiting-seats { display: flex; flex-wrap: wrap; gap: 6px; }
.mench-waiting-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.42);
}
html.dark .mench-waiting-chip,
.dark .mench-waiting-chip { background: rgba(15, 23, 42, 0.55); border-color: rgba(148, 163, 184, 0.28); }
.mench-waiting-chip .dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.mench-waiting-chip.is-empty { border-style: dashed; opacity: 0.72; }
.mench-waiting-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.mench-waiting-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 900;
    padding: 7px 12px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 8px 16px -10px rgba(79, 70, 229, 0.95);
    transition: filter 0.18s, transform 0.18s;
}
.mench-waiting-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.mench-waiting-code-label { font-size: 10px; font-weight: 800; opacity: 0.7; }
.mench-waiting-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 3px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.08);
}
html.dark .mench-waiting-code,
.dark .mench-waiting-code { background: rgba(2, 6, 23, 0.55); color: #e2e8f0; }

/* ── صندلی خالی در نوار بازیکنان ── */
.mench-player.is-empty {
    border: 1.5px dashed rgba(148, 163, 184, 0.55);
    background: rgba(148, 163, 184, 0.08);
    opacity: 0.75;
    box-shadow: none;
}
.mench-empty-ico {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    color: #94a3b8;
    border: 1.5px dashed rgba(148, 163, 184, 0.6);
    flex-shrink: 0;
}

/* ── کارت‌های میزهای زنده در سایدبار ── */
#mench-live { display: flex; flex-direction: column; gap: 8px; text-align: right; }
.mench-live-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    font-weight: 900;
    color: #475569;
    margin-bottom: 2px;
}
html.dark .mench-live-title,
.dark .mench-live-title { color: #cbd5e1; }
.mench-live-title-count {
    font-size: 10px;
    font-weight: 900;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.16);
    color: #4f46e5;
}
html.dark .mench-live-title-count,
.dark .mench-live-title-count { background: rgba(129, 140, 248, 0.22); color: #c7d2fe; }
.mench-live-empty {
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    color: #64748b;
    padding: 10px 6px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    border-radius: 12px;
}
html.dark .mench-live-empty,
.dark .mench-live-empty { color: #94a3b8; }
.mench-live-card {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 11px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s, transform 0.2s;
}
html.dark .mench-live-card,
.dark .mench-live-card { background: rgba(15, 23, 42, 0.72); border-color: rgba(148, 163, 184, 0.22); }
.mench-live-card:hover { transform: translateY(-1px); border-color: rgba(99, 102, 241, 0.55); }
.mench-live-card.is-live { border-color: rgba(244, 63, 94, 0.45); }
.mench-live-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mench-live-names {
    flex: 1;
    min-width: 0;
    font-size: 11.5px;
    font-weight: 900;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
html.dark .mench-live-names,
.dark .mench-live-names { color: #f1f5f9; }
.mench-live-cap {
    font-size: 10px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.16);
    color: #4f46e5;
    white-space: nowrap;
}
html.dark .mench-live-cap,
.dark .mench-live-cap { background: rgba(129, 140, 248, 0.22); color: #c7d2fe; }
.mench-live-meta {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    line-height: 1.7;
}
html.dark .mench-live-meta,
.dark .mench-live-meta { color: #94a3b8; }
.mench-live-join {
    width: 100%;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 900;
    padding: 8px 10px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    transition: filter 0.18s, transform 0.18s;
}
.mench-live-join:hover:not(:disabled) { filter: brightness(1.08); }
.mench-live-join.is-watch {
    background: rgba(148, 163, 184, 0.18);
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.4);
}
html.dark .mench-live-join.is-watch,
.dark .mench-live-join.is-watch { color: #cbd5e1; }
.mench-live-join:disabled { opacity: 0.7; cursor: not-allowed; }
.mench-live-joined {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    font-weight: 900;
    color: #047857;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 10px;
    padding: 7px 10px;
}
html.dark .mench-live-joined,
.dark .mench-live-joined { color: #6ee7b7; background: rgba(16, 185, 129, 0.16); }
.mench-live-open {
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0;
}

/* ── دکمه پیوستن پنل کد ── */
.mench-join-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    padding: 0 16px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #6d28d9);
    box-shadow: 0 10px 20px -12px rgba(79, 70, 229, 0.9);
    transition: filter 0.18s, transform 0.18s;
    white-space: nowrap;
}
.mench-join-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.mench-join-btn.is-joined {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 10px 20px -12px rgba(16, 185, 129, 0.9);
    cursor: default;
    transform: none;
}

/* ── سطح واضح برای کادر چت منچ (QBGameChat) ── */
#mench-unified-chat-panel { width: 100%; }
#mench-unified-chat-panel .qb-unified-chat {
    background: linear-gradient(180deg, #ffffff, #eef2ff) !important;
    border: 1px solid rgba(99, 102, 241, 0.32) !important;
    box-shadow: 0 18px 40px -26px rgba(15, 23, 42, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}
html.dark #mench-unified-chat-panel .qb-unified-chat,
.dark #mench-unified-chat-panel .qb-unified-chat {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98)) !important;
    border-color: rgba(129, 140, 248, 0.45) !important;
    box-shadow: 0 18px 44px -26px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
#mench-unified-chat-panel .qb-chat-box {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    min-height: 160px;
}
html.dark #mench-unified-chat-panel .qb-chat-box,
.dark #mench-unified-chat-panel .qb-chat-box {
    background: rgba(2, 6, 23, 0.55);
    border-color: rgba(148, 163, 184, 0.18);
}
#mench-unified-chat-panel .qb-chat-form {
    border-top: 1px dashed rgba(148, 163, 184, 0.35);
    padding-top: 9px;
    margin-top: 2px;
}
#mench-unified-chat-panel .qb-chat-input {
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
}
html.dark #mench-unified-chat-panel .qb-chat-input,
.dark #mench-unified-chat-panel .qb-chat-input {
    background: rgba(2, 6, 23, 0.6) !important;
    border-color: rgba(148, 163, 184, 0.25) !important;
    color: #e2e8f0;
}
#mench-unified-chat-panel .qb-chat-empty { padding: 28px 12px !important; opacity: 0.85; line-height: 1.9; }
#mench-unified-chat-panel .qb-voice-banner { border-radius: 12px; }
