/* ============================================================
   Night Engine Styles v11.0.0 Professional (Improved UI + Death Cards + Chat Notifications)
   ============================================================ */

/* ========== انیمیشن‌های پایه ========== */
@keyframes nightFloaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes nightRotateBg {
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes urgentPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bombPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255,0,0,0.3); }
    50% { box-shadow: 0 0 25px rgba(255,0,0,0.6); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(241,196,15,0.4); }
    50% { box-shadow: 0 0 50px rgba(241,196,15,0.9); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

/* ========== استیج اصلی شب ========== */
.mafia-night-stage {
    animation: fadeInUp 0.5s ease;
    position: relative;
    z-index: 1;
}

/* ========== کارت‌های گرید بازیکنان ========== */
.player-grid-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}

.player-grid-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-3px);
}

.player-grid-card.active {
    border-color: #2ecc71 !important;
    background: rgba(46,204,113,0.12) !important;
    box-shadow: 0 0 25px rgba(46,204,113,0.4);
    transform: scale(1.02);
}

.player-grid-card.done {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.7);
}

.player-grid-card img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(241,196,15,0.5);
    margin-bottom: 10px;
}

.player-grid-card.active img {
    border-color: #2ecc71;
    box-shadow: 0 0 25px rgba(46,204,113,0.5);
}

.player-grid-card .grid-name {
    font-weight: bold;
    color: #fff;
    font-size: 1.05em;
}

.player-grid-card .grid-seat {
    font-size: 0.85em;
    color: #f1c40f;
}

.player-grid-card .grid-role {
    font-size: 0.8em;
    color: #aaa;
}

.player-grid-card .grid-status {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 1.2em;
}

/* ========== باکس‌های نقش (اکشن شب) ========== */
.role-action-box {
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 12px;
}

.role-action-box h4 {
    color: #f1c40f;
    margin: 0 0 12px 0;
    font-size: 1.1em;
    text-align: center;
}

.role-action-box select,
.role-action-box input[type="text"],
.role-action-box input[type="number"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(0,0,0,0.5);
    border: 1px solid #555;
    border-radius: 12px;
    color: #fff;
    font-family: 'iran', sans-serif;
    font-size: 0.95em;
}

.role-action-box select:focus,
.role-action-box input:focus {
    outline: none;
    border-color: #f1c40f;
    box-shadow: 0 0 10px rgba(241,196,15,0.2);
}

.role-action-box button {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'iran', sans-serif;
    transition: all 0.3s;
    margin: 4px;
}

.role-action-box .btn-shot {
    background: #e74c3c;
    color: #fff;
}

.role-action-box .btn-save {
    background: #3498db;
    color: #fff;
}

.role-action-box .btn-buy {
    background: #f1c40f;
    color: #000;
}

.role-action-box .btn-special {
    background: #9b59b6;
    color: #fff;
}

.role-action-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* ========== تایمر اضطراری ========== */
.urgent-timer {
    color: #ff4757 !important;
    text-shadow: 0 0 35px rgba(255,71,87,0.7) !important;
    animation: urgentPulse 0.6s infinite;
}

/* ========== اسلایدر صدا ========== */
#welcome-volume-slider,
.volume-slider {
    cursor: pointer !important;
}

#welcome-volume-slider:disabled,
.volume-slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== نشانگر بمب (انیمیشن) ========== */
.bomb-badge {
    background: #ff0000;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    margin: 3px 2px;
    font-weight: bold;
    display: inline-block;
    animation: bombPulse 1s infinite;
}

/* ========== اسکرول بار سفارشی ========== */
.mafia-night-stage::-webkit-scrollbar {
    width: 8px;
}

.mafia-night-stage::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

.mafia-night-stage::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f1c40f, #e67e22);
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.3);
}

/* ========== استایل‌های مرحله آمادگی کاربران (user-ready-check) ========== */
.user-ready-card {
    background: linear-gradient(145deg, rgba(25,30,50,0.9), rgba(15,18,35,0.95));
    border-radius: 24px;
    padding: 18px 12px;
    text-align: center;
    border: 2px solid rgba(241,196,15,0.3);
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    position: relative;
}

.user-ready-card.ready {
    border-color: #2ecc71;
    background: linear-gradient(145deg, rgba(46,204,113,0.15), rgba(30,40,60,0.95));
    box-shadow: 0 0 25px rgba(46,204,113,0.4);
}

.user-ready-card img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f1c40f;
    margin-bottom: 12px;
}

.player-name-ready {
    font-weight: bold;
    font-size: 1.2em;
    margin: 5px 0 3px;
    color: #fff;
}

.player-seat-ready {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 12px;
}

.status-badges {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.badge-item {
    background: rgba(0,0,0,0.4);
    border-radius: 30px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
}

.badge-item.active {
    background: rgba(46,204,113,0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.badge-item.inactive {
    background: rgba(231,76,60,0.15);
    color: #e74c3c;
    border: 1px solid rgba(231,76,60,0.4);
}

.ready-status-text {
    margin-top: 12px;
    padding: 6px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    transition: 0.2s;
}

.ready-status-text.waiting {
    background: rgba(241,196,15,0.15);
    color: #f1c40f;
}

.ready-status-text.done {
    background: rgba(46,204,113,0.2);
    color: #2ecc71;
}

.checkmark-full {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 22px;
    color: #2ecc71;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

/* ========== استایل‌های کارت‌های مرگ آخر (Death Cards) ========== */
.death-cards-container {
    max-width: 900px;
    width: 90%;
    background: linear-gradient(145deg, #1a1a2e, #0f0f1a);
    border: 3px solid #f1c40f;
    border-radius: 30px;
    padding: 25px;
    box-shadow: 0 0 60px rgba(241,196,15,0.3);
}

.death-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.death-card {
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(241,196,15,0.3);
    border-radius: 20px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.death-card:hover {
    transform: translateY(-5px);
    border-color: #f1c40f;
    background: rgba(241,196,15,0.1);
    box-shadow: 0 0 20px rgba(241,196,15,0.3);
}

.death-card .card-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.death-card .card-name {
    font-weight: bold;
    color: #f1c40f;
    margin-bottom: 8px;
}

.death-card .card-desc {
    font-size: 12px;
    color: #aaa;
}

/* ========== استایل‌های نوتیفیکیشن چت در پنل گرداننده ========== */
#admin-chat-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10001;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: 2px solid #00d2ff;
    border-radius: 15px;
    padding: 12px 18px;
    color: #fff;
    min-width: 260px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    animation: slideInRight 0.3s ease-out;
    cursor: pointer;
}

/* ========== رسپانسیو ========== */
@media (max-width: 1200px) {
    #mafia-night-stage-3 > div,
    #mafia-night-stage-4 > div {
        flex-direction: column;
    }
    #mafia-mod-panel,
    #citizen-mod-panel {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .player-grid-card img {
        width: 60px;
        height: 60px;
    }
    .player-grid-card {
        padding: 10px 6px;
    }
    .player-grid-card .grid-name {
        font-size: 0.85em;
    }
    .role-action-box button {
        padding: 8px 16px;
        font-size: 0.8em;
    }
    .death-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .death-card {
        padding: 10px;
    }
    .death-card .card-icon {
        font-size: 30px;
    }
    .death-card .card-name {
        font-size: 12px;
    }
}

/* ========== کلاس‌های کمکی ========== */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 8px;
}

.mb-2 {
    margin-bottom: 8px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}