/* ===== المتغيرات العامة ===== */
:root {
    /* ألوان المحققين */
    --detective-blue: #1e3a8a;
    --detective-purple: #3730a3;
    --detective-deep: #4c1d95;
    --detective-light: #60a5fa;
    
    /* ألوان السارق */
    --thief-red: #7f1d1d;
    --thief-crimson: #991b1b;
    --thief-brown: #7c2d12;
    --thief-light: #ef4444;
    
    /* ألوان الأدلة */
    --evidence-gold: #ca8a04;
    --evidence-yellow: #eab308;
    --evidence-bright: #facc15;
    
    /* الخلفيات */
    --night-bg: #0f172a;
    --dark-panel: #1e293b;
    --lighter-panel: #334155;
    --card-bg: #475569;
    
    /* الألوان العامة */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* الظلال */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    
    /* الانتقالات */
    --transition: all 0.3s ease;
}

/* ===== إعدادات عامة ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--night-bg) 0%, #1e1b4b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(239, 68, 68, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== الشاشات ===== */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: block;
}

/* ===== رأس اللعبة ===== */
.game-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

.game-title {
    font-size: 3.5em;
    font-weight: bold;
    background: linear-gradient(135deg, var(--detective-light), var(--evidence-bright), var(--thief-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(250, 204, 21, 0.3);
}

.game-subtitle {
    font-size: 1.3em;
    color: var(--text-secondary);
    font-weight: 300;
}

.game-header-small {
    background: var(--dark-panel);
    padding: 15px 20px;
    border-bottom: 3px solid var(--evidence-gold);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.game-title-small {
    font-size: 1.8em;
    margin: 0;
    color: var(--evidence-bright);
    text-align: center;
}

/* ===== الشاشة الرئيسية ===== */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    animation: fadeIn 0.8s ease;
}

.input-section, .game-info {
    background: var(--dark-panel);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--lighter-panel);
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    border: 2px solid var(--lighter-panel);
    border-radius: 12px;
    background: var(--night-bg);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: var(--detective-light);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.button-group {
    margin-bottom: 25px;
}

.btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.3em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--detective-blue), var(--detective-purple));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--detective-purple), var(--detective-deep));
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
}

.btn-danger {
    background: linear-gradient(135deg, var(--thief-red), var(--thief-crimson));
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--thief-crimson), #b91c1c);
}

.btn-secondary {
    background: var(--lighter-panel);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--card-bg);
}

.btn-ready {
    background: linear-gradient(135deg, #ea580c, #f59e0b);
    color: white;
}

.btn-ready.ready {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.btn-ready.ready .btn-icon {
    content: '✅';
}

.btn-guess {
    background: linear-gradient(135deg, var(--evidence-gold), var(--evidence-yellow));
    color: var(--night-bg);
    font-weight: 700;
}

.btn-guess:hover {
    background: linear-gradient(135deg, var(--evidence-yellow), var(--evidence-bright));
}

.divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--lighter-panel);
}

.divider::before {
    right: 0;
}

.divider::after {
    left: 0;
}

.divider span {
    background: var(--dark-panel);
    padding: 0 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.game-info h3 {
    color: var(--evidence-bright);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.game-info ul {
    list-style: none;
}

.game-info li {
    padding: 12px 0;
    padding-right: 30px;
    border-bottom: 1px solid var(--lighter-panel);
    font-size: 1.05em;
    line-height: 1.6;
}

.game-info li:last-child {
    border-bottom: none;
}

/* ===== شاشة الانتظار ===== */
.room-code-display {
    margin-top: 20px;
    text-align: center;
}

.room-code-display > span {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 1.1em;
}

.room-code-box {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: var(--night-bg);
    padding: 15px 30px;
    border-radius: 12px;
    border: 2px solid var(--evidence-gold);
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.3);
}

.room-code-box span {
    font-size: 2em;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--evidence-bright);
    font-family: 'Courier New', monospace;
}

.copy-btn {
    background: var(--evidence-gold);
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 1.3em;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--evidence-yellow);
    transform: scale(1.1);
}

.share-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-share,
.btn-share-all {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-share-all {
    background: linear-gradient(135deg, #10b981, #059669);
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-share-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.waiting-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.players-section {
    background: var(--dark-panel);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--lighter-panel);
}

.players-section h2 {
    color: var(--detective-light);
    margin-bottom: 20px;
    font-size: 1.6em;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.player-card {
    background: var(--lighter-panel);
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.player-card.ready {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.1));
    border-color: var(--success);
}

.player-card.not-ready {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.1));
    border-color: var(--warning);
}

.player-card.eliminated {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(127, 29, 29, 0.1));
    border-color: var(--danger);
    opacity: 0.7;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-icon {
    font-size: 1.5em;
}

.player-name {
    font-size: 1.1em;
    font-weight: 600;
}

.player-badge {
    background: var(--evidence-gold);
    color: var(--night-bg);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    margin-right: 10px;
}

.kick-btn {
    background: var(--thief-red);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    transition: var(--transition);
}

.kick-btn:hover {
    background: var(--thief-crimson);
    transform: scale(1.1);
}

.spectators-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid var(--lighter-panel);
}

.spectators-section h3 {
    color: var(--info);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.spectators-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spectator-badge {
    background: var(--card-bg);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.95em;
    border: 1px solid var(--info);
}

.controls-section {
    background: var(--dark-panel);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--lighter-panel);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-message {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--info);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== شاشة عرض الأدوار ===== */
.role-reveal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.role-card {
    background: var(--dark-panel);
    border-radius: 25px;
    padding: 60px;
    box-shadow: var(--shadow-xl);
    border: 3px solid;
    max-width: 600px;
    width: 100%;
    text-align: center;
    animation: roleReveal 0.8s ease;
}

.role-card.thief {
    border-color: var(--thief-light);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
}

.role-card.detective {
    border-color: var(--detective-light);
    box-shadow: 0 0 40px rgba(96, 165, 250, 0.4);
}

.role-card.spectator {
    border-color: var(--info);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.4);
}

.role-card h2 {
    font-size: 3em;
    margin-bottom: 30px;
}

.role-card.thief h2 {
    color: var(--thief-light);
}

.role-card.detective h2 {
    color: var(--detective-light);
}

.role-card.spectator h2 {
    color: var(--info);
}

.stolen-item-display {
    background: linear-gradient(135deg, var(--evidence-gold), var(--evidence-yellow));
    color: var(--night-bg);
    padding: 25px;
    border-radius: 15px;
    margin: 25px 0;
    font-size: 1.8em;
    font-weight: 700;
    box-shadow: 0 0 30px rgba(234, 179, 8, 0.5);
}

.role-instructions {
    background: var(--lighter-panel);
    padding: 25px;
    border-radius: 15px;
    margin-top: 25px;
    text-align: right;
}

.role-instructions h3 {
    color: var(--evidence-bright);
    margin-bottom: 15px;
    font-size: 1.4em;
}

.role-instructions ul {
    list-style: none;
}

.role-instructions li {
    padding: 10px 0;
    font-size: 1.05em;
    line-height: 1.6;
    border-bottom: 1px solid var(--card-bg);
}

.role-instructions li:last-child {
    border-bottom: none;
}

.thief-info {
    color: var(--text-secondary);
    margin-top: 20px;
    font-size: 1.1em;
}

.countdown-timer {
    margin-top: 40px;
    font-size: 4em;
    font-weight: 700;
    color: var(--evidence-bright);
    text-align: center;
    animation: pulse 1s infinite;
}

/* ===== شاشة الأسئلة ===== */
.player-status-bar {
    background: var(--lighter-panel);
    padding: 15px 20px;
    border-radius: 12px;
    margin-top: 15px;
    text-align: center;
}

.status-thief {
    background: linear-gradient(135deg, var(--evidence-gold), var(--evidence-yellow));
    color: var(--night-bg);
    font-weight: 700;
    font-size: 1.2em;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.4);
}

.status-detective {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    font-size: 1.1em;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.questions-container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
}

.main-game-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.questions-log-section {
    background: var(--dark-panel);
    padding: 25px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--lighter-panel);
    flex: 1;
}

.questions-log-section h3 {
    color: var(--detective-light);
    margin-bottom: 20px;
    font-size: 1.4em;
}

.questions-log {
    max-height: 400px;
    overflow-y: auto;
    padding-left: 10px;
}

.question-item {
    background: var(--lighter-panel);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-right: 4px solid;
    transition: var(--transition);
}

.question-item:hover {
    transform: translateX(-5px);
}

.question-item.guess-question {
    background: linear-gradient(to left, var(--lighter-panel), rgba(234, 179, 8, 0.15));
    border-right: 4px solid var(--evidence-gold);
}

.question-item.answer-yes {
    border-color: var(--success);
    background: linear-gradient(to left, var(--lighter-panel), rgba(34, 197, 94, 0.1));
}

.question-item.answer-no {
    border-color: var(--danger);
    background: linear-gradient(to left, var(--lighter-panel), rgba(239, 68, 68, 0.1));
}

.question-item.answer-maybe {
    border-color: #8b5cf6;
    background: linear-gradient(to left, var(--lighter-panel), rgba(139, 92, 246, 0.1));
}

.question-item.answer-close {
    border-color: var(--warning);
    background: linear-gradient(to left, var(--lighter-panel), rgba(245, 158, 11, 0.1));
}

.question-item.answer-far {
    border-color: var(--danger);
    background: linear-gradient(to left, var(--lighter-panel), rgba(239, 68, 68, 0.1));
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.question-player {
    font-weight: 600;
    color: var(--detective-light);
    font-size: 1.1em;
}

.question-text {
    color: var(--text-primary);
    font-size: 1.05em;
    margin-bottom: 10px;
    line-height: 1.5;
}

.question-answer {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95em;
}

.answer-yes .question-answer {
    background: var(--success);
    color: white;
}

.answer-no .question-answer {
    background: var(--danger);
    color: white;
}

.answer-maybe .question-answer {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.answer-close .question-answer {
    background: var(--warning);
    color: white;
}

.answer-far .question-answer {
    background: var(--danger);
    color: white;
}

.current-question-section {
    background: var(--dark-panel);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--lighter-panel);
    min-height: 300px;
}

.turn-indicator {
    text-align: center;
    padding: 40px;
}

.turn-indicator h2 {
    font-size: 2em;
    color: var(--detective-light);
    margin-bottom: 15px;
}

.turn-timer {
    font-size: 3em;
    font-weight: 700;
    margin: 20px 0;
}

.timer-normal {
    color: var(--success);
}

.timer-warning {
    color: var(--warning);
}

.timer-danger {
    color: var(--danger);
    animation: pulse 0.5s infinite;
}

.waiting-message {
    color: var(--text-secondary);
    font-size: 1.2em;
}

.question-form {
    text-align: center;
}

.question-form h3 {
    color: var(--evidence-bright);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.question-input-group {
    margin-bottom: 20px;
}

.question-input-group textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid var(--lighter-panel);
    border-radius: 12px;
    background: var(--night-bg);
    color: var(--text-primary);
    resize: vertical;
    font-family: inherit;
    transition: var(--transition);
}

.question-input-group textarea:focus {
    outline: none;
    border-color: var(--detective-light);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.char-counter {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 5px;
}

.answer-buttons {
    text-align: center;
}

.answer-buttons h3 {
    color: var(--evidence-bright);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.answer-question-text {
    background: var(--lighter-panel);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 1.2em;
    line-height: 1.6;
}

.answer-question-from {
    color: var(--detective-light);
    font-weight: 600;
    margin-bottom: 10px;
}

.answer-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.answer-btn {
    padding: 20px 40px;
    font-size: 1.3em;
    font-weight: 700;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    min-width: 150px;
}

.answer-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.answer-btn-yes {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
}

.answer-btn-no {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: white;
}

.answer-btn-maybe {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.answer-btn-close {
    background: linear-gradient(135deg, #ea580c, #f59e0b);
    color: white;
}

.answer-btn-far {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: white;
}

/* ===== الشريط الجانبي في اللعبة ===== */
.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== لوحة الإحصائيات ===== */
.sidebar-stats {
    background: var(--dark-panel);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--lighter-panel);
    margin-bottom: 20px;
}

.sidebar-stats h3 {
    color: var(--evidence-gold);
    margin-bottom: 15px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.players-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-stat-card {
    background: var(--lighter-panel);
    padding: 12px;
    border-radius: 10px;
    border-left: 4px solid var(--detective-blue);
}

.player-stat-card.thief {
    border-left-color: var(--thief-red);
}

.player-stat-card.eliminated {
    opacity: 0.6;
    background: var(--night-bg);
}

.player-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.player-stat-name {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-stat-role {
    font-size: 0.85em;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--detective-blue);
    color: white;
}

.player-stat-role.thief {
    background: var(--thief-red);
}

.player-stat-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.9em;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1em;
}

.stat-value.danger {
    color: var(--danger);
}

.stat-value.warning {
    color: var(--warning);
}

.stat-value.success {
    color: var(--success);
}

.sidebar-players {
    background: var(--dark-panel);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--lighter-panel);
}

.sidebar-players h3 {
    color: var(--detective-light);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.game-players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-player-card {
    background: var(--lighter-panel);
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.game-player-card.active {
    border-color: var(--evidence-gold);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.3);
}

.game-player-card.eliminated {
    opacity: 0.5;
    background: var(--night-bg);
}

.game-player-icon {
    font-size: 1.3em;
}

.game-player-name {
    flex: 1;
    font-weight: 600;
}

.quick-guess-section {
    background: var(--dark-panel);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--evidence-gold);
}

.leave-game-section {
    background: var(--dark-panel);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid #ef4444;
}

.btn-leave {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    width: 100%;
    padding: 15px 25px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-leave:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-leave:active {
    transform: translateY(0);
}

.sidebar-chat {
    background: var(--dark-panel);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--lighter-panel);
    flex: 1;
    min-height: 300px;
}

/* ===== شاشة النتائج ===== */
.results-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

.results-content {
    background: var(--dark-panel);
    padding: 50px;
    border-radius: 25px;
    box-shadow: var(--shadow-xl);
    border: 3px solid;
    text-align: center;
    animation: fadeInScale 0.6s ease;
}

.results-content.detectives-win {
    border-color: var(--detective-light);
    box-shadow: 0 0 40px rgba(96, 165, 250, 0.4);
}

.results-content.thief-win {
    border-color: var(--thief-light);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
}

.results-title {
    font-size: 3em;
    margin-bottom: 30px;
}

.results-content.detectives-win .results-title {
    color: var(--detective-light);
}

.results-content.thief-win .results-title {
    color: var(--thief-light);
}

.winner-display {
    background: linear-gradient(135deg, var(--evidence-gold), var(--evidence-yellow));
    color: var(--night-bg);
    padding: 25px;
    border-radius: 15px;
    font-size: 2em;
    font-weight: 700;
    margin: 25px 0;
    box-shadow: 0 0 30px rgba(234, 179, 8, 0.5);
}

.results-message {
    font-size: 1.3em;
    color: var(--text-secondary);
    margin: 20px 0;
    line-height: 1.6;
}

.results-stats {
    background: var(--lighter-panel);
    padding: 25px;
    border-radius: 15px;
    margin-top: 30px;
    text-align: right;
}

.results-stats h3 {
    color: var(--evidence-bright);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.stat-item {
    padding: 12px 0;
    font-size: 1.1em;
    border-bottom: 1px solid var(--card-bg);
}

.stat-item:last-child {
    border-bottom: none;
}

.results-actions {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.results-actions .btn {
    flex: 1;
}

/* ===== النافذة المنبثقة ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--dark-panel);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--evidence-gold);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid var(--lighter-panel);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--evidence-bright);
    font-size: 1.6em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--lighter-panel);
    color: var(--danger);
}

.modal-body {
    padding: 30px;
}

.guess-attempts {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.1em;
}

.guess-attempts span {
    color: var(--evidence-bright);
    font-weight: 700;
    font-size: 1.3em;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid var(--lighter-panel);
    display: flex;
    gap: 15px;
}

.modal-footer .btn {
    flex: 1;
}

.error-message {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
}

/* ===== الإشعارات ===== */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--dark-panel);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--success);
    z-index: 2000;
    min-width: 300px;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    opacity: 0;
    transition: all 0.4s ease;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification.success {
    border-color: var(--success);
    color: var(--success);
}

.notification.error {
    border-color: var(--danger);
    color: var(--danger);
}

.notification.info {
    border-color: var(--info);
    color: var(--info);
}

.notification.warning {
    border-color: var(--warning);
    color: var(--warning);
}

/* ===== الرسوم المتحركة ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes roleReveal {
    from {
        opacity: 0;
        transform: rotateY(90deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* ===== التمرير المخصص ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--night-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--lighter-panel);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--card-bg);
}

/* ===== التصميم المتجاوب ===== */
@media (max-width: 1200px) {
    .questions-container {
        grid-template-columns: 1fr 350px;
    }
}

@media (max-width: 992px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .waiting-container {
        grid-template-columns: 1fr;
    }
    
    .questions-container {
        grid-template-columns: 1fr;
    }
    
    .game-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sidebar-players,
    .quick-guess-section,
    .sidebar-chat {
        flex: 1;
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2.5em;
    }
    
    .game-subtitle {
        font-size: 1.1em;
    }
    
    .input-section, .game-info {
        padding: 25px;
    }
    
    .players-list {
        grid-template-columns: 1fr;
    }
    
    .answer-options {
        flex-direction: column;
    }
    
    .answer-btn {
        width: 100%;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .btn-share,
    .btn-share-all {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2em;
    }
    
    .room-code-box span {
        font-size: 1.5em;
        letter-spacing: 3px;
    }
    
    .role-card {
        padding: 30px;
    }
    
    .role-card h2 {
        font-size: 2em;
    }
    
    .countdown-timer {
        font-size: 3em;
    }
}
