/* لعبة المافيا - التصميم الموحد */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* النماذج */
.form-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    margin: 50px auto;
}

.form-title {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: bold;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1e3c72;
}

.btn {
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
    margin: 0 5px;
}

.btn:first-child {
    margin-right: 0;
}

.btn:last-child {
    margin-left: 0;
}

/* Flexbox utilities */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.d-flex .btn {
    width: auto;
    flex: 1;
    margin: 0 5px;
}

.d-flex .btn:first-child {
    margin-right: 0;
}

.d-flex .btn:last-child {
    margin-left: 0;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.text-center {
    text-align: center;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

.d-grid {
    display: grid;
}

.gap-3 {
    gap: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #495057);
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #c82333);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.btn-warning {
    background: linear-gradient(45deg, #ffc107, #e0a800);
    color: #212529;
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #138496);
}

/* قائمة الغرف */
.rooms-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
}

.room-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
    border-left: 4px solid #28a745;
}

.room-item:hover {
    border-color: #1e3c72;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.room-item.private-room {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #f8f9fa, rgba(255, 193, 7, 0.05));
}

.private-badge {
    background: #ffc107;
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.room-name {
    font-size: 18px;
    font-weight: bold;
    color: #1e3c72;
}

.room-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-waiting {
    background: #fff3cd;
    color: #856404;
}

.status-role_recognition {
    background: #ffeaa7;
    color: #d63031;
}

.status-playing {
    background: #d4edda;
    color: #155724;
}

.status-full {
    background: #f8d7da;
    color: #721c24;
}

.room-info {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 14px;
}

/* واجهة اللعب */
.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-title {
    font-size: 28px;
    color: #1e3c72;
    margin-bottom: 10px;
}

.game-phase {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.player-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
}

.player-card:hover {
    border-color: #1e3c72;
    transform: translateY(-2px);
}

.player-card.dead {
    opacity: 0.5;
    background: #f8d7da;
    border-color: #dc3545;
}

.player-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.player-role {
    font-size: 12px;
    color: #666;
}

/* التصويت */
.vote-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.vote-title {
    text-align: center;
    margin-bottom: 20px;
    color: #1e3c72;
    font-weight: bold;
}

.vote-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.vote-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.vote-option:hover {
    border-color: #1e3c72;
    background: #f8f9fa;
}

.vote-option.selected {
    border-color: #1e3c72;
    background: #1e3c72;
    color: white;
}

.vote-option.voted {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.vote-option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.player-name {
    flex: 1;
}

.mafia-votes-indicator {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

/* الرسائل */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* التحميل */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1e3c72;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* التنقل */
.nav-bar {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-logo {
    font-size: 24px;
    font-weight: bold;
    color: #1e3c72;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #1e3c72;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: #f8f9fa;
}

/* التجاوب */
@media (max-width: 768px) {
    .container {
        padding: 5px;
    }

    .form-container {
        padding: 20px;
        margin: 30px auto;
    }

    .players-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .player-card {
        padding: 4px;
    }
    
    .player-name {
        font-size: 10px;
    }
    
    .player-role {
        font-size: 8px;
    }

    .nav-container {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links {
        flex-direction: column;
        gap: 8px;
    }

    /* تصغير المسافات والهوامش */
    .game-container {
        padding: 5px;
    }

    .game-header {
        padding: 8px;
        margin-bottom: 10px;
    }

    .game-title {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .game-phase {
        font-size: 12px;
        margin-bottom: 5px;
    }

    /* تصغير بطاقات اللاعبين */
    .player-card {
        padding: 6px;
        margin-bottom: 4px;
        border-radius: 6px;
    }

    .player-name {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .player-role {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .player-status {
        font-size: 10px;
    }

    /* تصغير منطقة التصويت */
    .vote-container {
        padding: 10px;
        margin-bottom: 8px;
    }

    .vote-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .vote-options {
        gap: 4px;
    }

    .vote-option {
        padding: 8px;
        font-size: 11px;
        border-radius: 6px;
    }

    /* تصغير معلومات اللاعب */
    .info-card {
        padding: 8px;
        margin-bottom: 10px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        font-size: 11px;
    }

    .info-card h3 {
        display: none;
    }

    .info-card p {
        font-size: 11px;
        margin: 0;
        display: inline;
    }

    .info-card p:not(:last-child)::after {
        content: " | ";
        margin: 0 4px;
    }

    /* تصغير العداد التنازلي */
    .countdown-timer {
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 12px;
    }

    .countdown-icon {
        font-size: 16px;
    }

    .countdown-time {
        font-size: 18px;
        font-weight: bold;
    }

    .countdown-phase {
        font-size: 14px;
    }

    /* تصغير نتائج التصويت */
    .voting-results {
        padding: 10px;
        border-radius: 8px;
    }

    .results-title {
        font-size: 14px;
    }

    .result-message {
        font-size: 12px;
        padding: 8px;
    }

    .vote-breakdown {
        gap: 8px;
    }

    .breakdown-item {
        font-size: 11px;
    }

    .breakdown-value {
        font-size: 12px;
    }

    /* تصغير قائمة اللاعبين النهائية */
    .final-players-list {
        padding: 10px;
    }

    .final-players-header h4 {
        font-size: 16px;
    }

    .final-players-grid {
        gap: 6px;
    }

    .final-player-card {
        padding: 8px;
        border-radius: 6px;
    }

    .final-player-name {
        font-size: 12px;
    }

    .final-player-role {
        font-size: 10px;
    }

    .host-badge {
        font-size: 12px;
        padding: 2px 4px;
    }

    /* تصغير الأزرار */
    .btn {
        padding: 8px 16px;
        font-size: 12px;
        border-radius: 6px;
    }

    .host-actions {
        gap: 6px;
    }

    .host-actions .btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .general-buttons {
        gap: 6px;
    }

    .general-buttons .btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* تصغير الرسائل */
    .message {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 6px;
    }

    /* تصغير الإجراءات الخاصة */
    .special-role-action {
        padding: 10px;
        margin-bottom: 8px;
    }

    .action-header {
        margin-bottom: 6px;
    }

    .action-title {
        font-size: 14px;
    }

    .action-content p {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .target-selection {
        gap: 6px;
    }

    .target-selection select {
        padding: 6px 8px;
        font-size: 11px;
    }

    .target-selection .btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .hypnotist-action .voting-buttons {
        gap: 6px;
    }

    .hypnotist-action .hypnotist-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* تصغير رسالة التنويم */
    .hypnotized-message {
        padding: 10px;
        border-radius: 8px;
    }

    .hypnotized-icon {
        font-size: 20px;
    }

    .hypnotized-text h3 {
        font-size: 14px;
    }

    .hypnotized-text p {
        font-size: 11px;
    }

    /* تصغير المسافات الإضافية */
    .vote-container,
    #nightVoteContainer,
    #specialActionsContainer {
        margin-bottom: 8px;
    }

    .players-section {
        margin-top: 6px;
    }

    .players-section h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    

}

/* إخفاء العناصر */
.hidden {
    display: none !important;
}

/* تأثيرات إضافية */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* تنسيقات الأدوار */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.role-item {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.role-item:hover {
    border-color: #1e3c72;
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.15);
    transform: translateY(-2px);
}

.role-item.mafia-role {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.role-item.mafia-role:hover {
    border-color: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    margin-left: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkmark {
    position: relative;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 2px solid #1e3c72;
    border-radius: 4px;
    margin-left: 12px;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #1e3c72;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.role-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e3c72;
    margin-right: 8px;
}

.role-desc {
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
}

.role-count {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.role-count label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.role-count input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.role-count input[type="number"]:focus {
    border-color: #1e3c72;
    outline: none;
}

.roles-summary {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.summary-item {
    margin-bottom: 10px;
    font-size: 14px;
    color: #495057;
}

.summary-item:last-child {
    margin-bottom: 0;
}

/* تحسين التجاوب للأدوار */
@media (max-width: 768px) {
    .roles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .role-item {
        padding: 15px;
    }
    
    .checkbox-label {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* أزرار المضيف */
.host-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
    align-items: center;
}

.host-actions .btn {
    flex: 1;
    min-width: 150px;
    margin: 0;
}

/* تحسين أزرار المضيف للعرض الجوال */
@media (max-width: 768px) {
    .host-actions {
        flex-direction: column;
        gap: 10px;
        justify-content: flex-start;
        align-items: stretch;
    }
    
    .host-actions .btn {
        width: 100%;
        min-width: auto;
        padding: 15px;
        font-size: 16px;
        margin: 0;
    }
}

/* الأزرار العامة لجميع اللاعبين */
.general-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.general-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.general-buttons .btn {
    flex: 1;
    min-width: 150px;
    margin: 0;
}

/* تحسين الأزرار العامة للعرض الجوال */
@media (max-width: 768px) {
    .general-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .general-buttons .btn {
        width: 100%;
        min-width: auto;
        padding: 15px;
        font-size: 16px;
    }
}

/* تفاصيل الغرفة */
.room-details-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
    max-width: 800px;
    overflow-x: hidden;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 10px;
}

.room-header h2 {
    margin: 0;
    font-size: 1.8em;
}

.room-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.status-waiting { background: #28a745; }
.status-role_recognition { background: #fd7e14; }
.status-night { background: #343a40; }
.status-day { background: #ffc107; color: #212529; }
.status-voting { background: #dc3545; }
.status-results { background: #17a2b8; }
.status-finished { background: #6c757d; }

.room-code-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.room-code-input {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    color: #495057;
    letter-spacing: 2px;
    cursor: text;
    user-select: all;
}

.room-code-input:focus {
    outline: none;
    border-color: #007bff;
    background: white;
}

.btn-copy {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.btn-copy:hover {
    background: #218838;
    transform: scale(1.05);
}

.btn-copy:active {
    transform: scale(0.95);
}

.copy-icon {
    font-size: 18px;
}

.players-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.players-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #495057;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

.player-item:last-child {
    border-bottom: none;
}

.player-name {
    font-weight: bold;
    color: #495057;
}

.host-badge {
    background: #ffc107;
    color: #212529;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-left: 10px;
}

.alive-badge { 
    background: #28a745; 
    color: white; 
    padding: 2px 8px; 
    border-radius: 12px; 
    font-size: 0.8em; 
}

.dead-badge { 
    background: #6c757d; 
    color: white; 
    padding: 2px 8px; 
    border-radius: 12px; 
    font-size: 0.8em; 
}

.room-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-large {
    padding: 12px 30px;
    font-size: 1.1em;
}

.room-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-item .label {
    font-weight: 600;
    color: #495057;
}

.info-item .value {
    color: #1e3c72;
    font-weight: 500;
}

/* قائمة الأدوار */
.roles-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.roles-list .role-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.roles-list .role-item:hover {
    border-color: #1e3c72;
    box-shadow: 0 2px 4px rgba(30, 60, 114, 0.1);
}

.roles-list .role-name {
    font-weight: 600;
    color: #1e3c72;
}

.roles-list .role-count {
    background: #1e3c72;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

/* تحسين التجاوب لتفاصيل الغرفة */
@media (max-width: 768px) {
    .container {
        padding: 5px;
    }
    
    .room-details-container {
        max-width: 100%;
        padding: 0;
    }
    
    .room-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 10px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .room-header h2 {
        font-size: 1.2em;
        margin: 0;
        line-height: 1.2;
    }
    
    .room-status {
        padding: 4px 8px;
        font-size: 0.7em;
        border-radius: 12px;
    }
    
    .room-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .info-card {
        padding: 10px;
        border-radius: 6px;
    }
    
    .info-card h3 {
        font-size: 1em;
        margin-bottom: 8px;
        padding-bottom: 5px;
    }
    
    .info-item {
        margin-bottom: 6px;
        padding: 4px 0;
        font-size: 0.8em;
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    
    .room-code-input {
        font-size: 12px;
        padding: 6px;
        letter-spacing: 1px;
    }
    
    .btn-copy {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 35px;
    }
    
    .copy-icon {
        font-size: 12px;
    }
    
    .players-section {
        padding: 10px;
        margin-bottom: 15px;
        border-radius: 6px;
    }
    
    .players-section h3 {
        font-size: 1em;
        margin-bottom: 10px;
    }
    
    .player-item {
        padding: 6px;
        font-size: 0.8em;
        border-bottom: 1px solid #eee;
    }
    
    .host-badge {
        font-size: 0.6em;
        padding: 1px 4px;
        border-radius: 8px;
    }
    
    .alive-badge, .dead-badge {
        font-size: 0.6em;
        padding: 1px 4px;
        border-radius: 8px;
    }
    
    .room-actions {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    
    .btn-large {
        padding: 8px 16px;
        font-size: 0.9em;
        border-radius: 6px;
    }
    
    .roles-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .role-item {
        font-size: 0.7em;
        padding: 4px;
        border-radius: 4px;
    }
}

/* زر العودة للغرفة */
.btn-link {
    background: #28a745 !important;
    border: 2px solid #28a745 !important;
    color: white !important;
    text-decoration: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: bold;
    margin: 0 10px;
}

.btn-link:hover {
    background: #218838 !important;
    border-color: #218838 !important;
    text-decoration: none;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* العداد التنازلي */
.countdown-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #007bff;
    border-radius: 12px;
    padding: 12px 20px;
    margin: 15px auto;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* قسم نتائج اللعبة */
.game-results-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
}

.result-item {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #28a745;
}

.result-item h4 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 14px;
}

.result-item p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.countdown-timer.warning {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.countdown-timer.danger {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.countdown-icon {
    font-size: 24px;
    color: #007bff;
}

.countdown-time {
    font-size: 20px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #333;
    min-width: 60px;
    text-align: center;
}

.countdown-phase {
    font-size: 14px;
    color: #666;
    font-weight: bold;
}

@media (max-width: 768px) {
    .countdown-timer {
        padding: 10px 15px;
        margin: 10px auto;
        max-width: 280px;
    }
    
    .countdown-icon {
        font-size: 20px;
    }
    
    .countdown-time {
        font-size: 18px;
        min-width: 50px;
    }
    
    .countdown-phase {
        font-size: 12px;
    }
}

/* نتائج التصويت */
.voting-results {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 15px auto;
    max-width: 400px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: white;
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.results-icon {
    font-size: 24px;
    animation: bounce 2s infinite;
}

.results-title {
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.results-content {
    text-align: center;
}

.result-message {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.vote-breakdown {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.breakdown-label {
    font-size: 12px;
    opacity: 0.8;
    font-weight: bold;
}

.breakdown-value {
    font-size: 20px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 6px;
    min-width: 30px;
    text-align: center;
}

.skip-votes {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.highest-votes {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.killed-player-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15), rgba(108, 117, 125, 0.15));
    border-radius: 12px;
    border: 2px solid rgba(220, 53, 69, 0.2);
    animation: pulse 2s infinite;
}

.killed-icon {
    font-size: 32px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.killed-details {
    text-align: center;
}

.killed-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #dc3545;
}

.killed-votes {
    font-size: 14px;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .voting-results {
        margin: 10px auto;
        padding: 15px;
        max-width: 350px;
    }
    
    .results-title {
        font-size: 16px;
    }
    
    .result-message {
        font-size: 14px;
    }
    
    .vote-breakdown {
        flex-direction: column;
        gap: 10px;
    }
    
    .breakdown-value {
        font-size: 18px;
    }
    
    .killed-player-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .killed-icon {
        font-size: 28px;
    }
    
    .killed-name {
        font-size: 16px;
    }
}

/* قائمة اللاعبين النهائية */
.final-players-list {
    margin: 15px auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.6s ease-out;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.final-players-header {
    text-align: center;
    margin-bottom: 10px;
}

.final-players-header h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.final-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
}

.final-player-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.final-player-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.final-player-card.alive {
    border-color: #28a745;
    background: linear-gradient(135deg, #ffffff, rgba(40, 167, 69, 0.1));
}

.final-player-card.dead {
    border-color: #dc3545;
    background: linear-gradient(135deg, #ffffff, rgba(220, 53, 69, 0.1));
    opacity: 0.8;
}

.final-player-name {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #212529;
    position: relative;
}

.host-badge {
    background: linear-gradient(135deg, #ffc107, #ff8c00);
    color: #212529;
    padding: 1px 4px;
    border-radius: 6px;
    font-size: 8px;
    font-weight: bold;
    margin-right: 4px;
    box-shadow: 0 1px 2px rgba(255, 193, 7, 0.3);
}

.final-player-role {
    font-size: 10px;
    color: #000;
    margin-bottom: 5px;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-weight: 600;
}

.final-player-status {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.final-player-status.alive {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 1px 4px rgba(40, 167, 69, 0.3);
}

.final-player-status.dead {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 1px 4px rgba(220, 53, 69, 0.3);
}

.status-icon {
    font-size: 14px;
    animation: pulse 2s infinite;
}

@media (max-width: 768px) {
    .final-players-list {
        margin: 10px auto;
        padding: 12px;
        max-width: 350px;
    }
    
    .final-players-header h4 {
        font-size: 14px;
    }
    
    .final-players-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        max-height: 150px;
    }
    
    .final-player-card {
        padding: 6px;
    }
    
    .final-player-name {
        font-size: 10px;
    }
    
    .final-player-role {
        font-size: 8px;
    }
    
    .final-player-status {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .host-badge {
        font-size: 6px;
        padding: 1px 3px;
    }
}

/* النافذة المنبثقة */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s ease-out;
}

.modal-content h3 {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: bold;
}

.modal-content p {
    color: #333;
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-buttons .btn {
    padding: 10px 25px;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* أنماط الأدوار الجديدة */
.role-lawyer {
    background: #6f42c1;
    color: white;
}

.role-hypnotist {
    background: #e83e8c;
    color: white;
}

/* أنماط خيارات الأدوار الخاصة */
.special-role-action {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-left: 5px solid #1e3c72;
}

.lawyer-action {
    border-left-color: #6f42c1;
}

.hypnotist-action {
    border-left-color: #e83e8c;
}

.action-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.action-icon {
    font-size: 24px;
    margin-left: 10px;
}

.action-title {
    font-size: 18px;
    font-weight: bold;
    color: #1e3c72;
}

.action-content p {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.5;
}

.target-selection {
    display: flex;
    gap: 10px;
    align-items: center;
}

.target-selection select {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.target-selection select:focus {
    outline: none;
    border-color: #1e3c72;
}

.target-selection .btn {
    white-space: nowrap;
    margin: 0;
}

.hypnotist-action .voting-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.hypnotist-action .hypnotist-btn {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.hypnotist-action .hypnotist-btn:hover {
    background: #545b62;
}

.hypnotist-action .hypnotist-btn.voted {
    background: #28a745;
}

.hypnotist-action .hypnotist-btn.voted:hover {
    background: #1e7e34;
}

/* أنماط رسالة التنويم */
.hypnotized-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-left: 5px solid #e83e8c;
}

.hypnotized-icon {
    font-size: 48px;
    margin-left: 20px;
}

.hypnotized-text h3 {
    color: #e83e8c;
    margin: 0 0 10px 0;
    font-size: 20px;
}

.hypnotized-text p {
    color: #666;
    margin: 0;
    font-size: 16px;
}

@media (max-width: 768px) {
    .target-selection {
        flex-direction: column;
        gap: 10px;
    }
    
    .target-selection .btn {
        width: 100%;
    }
    
    .hypnotist-action .voting-buttons {
        flex-direction: column;
    }
    
    .hypnotist-action .hypnotist-btn {
        width: 100%;
    }
}

.vote-container,
#nightVoteContainer,
#specialActionsContainer {
    margin-bottom: 8px;
}

#nightVoteContainer {
    margin-top: 8px;
}

@media (max-width: 768px) {
    .vote-container,
    #nightVoteContainer,
    #specialActionsContainer {
        margin-bottom: 8px;
    }
    
    #nightVoteContainer {
        margin-top: 8px;
    }
    .players-section {
        margin-top: 8px;
    }
}

/* رسائل اللعبة الجديدة */
.game-message {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #1e3c72;
    position: relative;
}

.game-message.night-kill-message {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(255, 255, 255, 0.95));
}

.game-message.investigation-message {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1), rgba(255, 255, 255, 0.95));
}

.game-message.kick-message {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 255, 255, 0.95));
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.message-icon {
    font-size: 20px;
    margin-left: 8px;
}

.message-title {
    font-size: 16px;
    font-weight: bold;
    color: #1e3c72;
    flex-grow: 1;
}

.message-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.message-close:hover {
    background: #f0f0f0;
    color: #666;
}

.message-content {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.message-content p {
    margin: 5px 0;
}

.message-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: flex-end;
}

.message-actions .btn {
    padding: 8px 16px;
    font-size: 12px;
    margin: 0;
}

@media (max-width: 768px) {
    .game-message {
        padding: 12px;
        margin: 8px 0;
        border-radius: 8px;
    }

    .message-header {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .message-icon {
        font-size: 18px;
    }

    .message-title {
        font-size: 14px;
    }

    .message-close {
        font-size: 18px;
        width: 20px;
        height: 20px;
    }

    .message-content {
        font-size: 12px;
    }

    .message-actions {
        gap: 8px;
        margin-top: 10px;
    }

    .message-actions .btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

