:root {
    --bg: #1a1a2e;
    --bg2: #16213e;
    --bg3: #0f3460;
    --text: #eaeaea;
    --text2: #a0a0a0;
    --primary: #e94560;
    --secondary: #4ECDC4;
    --accent: #FFE66D;
    --purple: #C44DFF;
    --success: #4ECDC4;
    --warning: #FFE66D;
    --danger: #e94560;
    --border: #3a3a5c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 100%);
    color: var(--text);
    min-height: 100vh;
    direction: rtl;
}

.hidden { display: none !important; }

/* Decorative Background */
.grid-bg {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(233, 69, 96, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(78, 205, 196, 0.1) 0%, transparent 50%);
    z-index: -1;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
}

.header p { color: var(--text2); letter-spacing: 2px; font-size: 1.1rem; }

/* Cards */
.card {
    background: rgba(22, 33, 62, 0.8);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.card-title {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #ff7b93);
    color: white;
}

.btn-primary:hover { 
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4); 
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
}

.btn-secondary:hover { 
    background: var(--secondary); 
    color: var(--bg); 
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 8px; color: var(--text2); font-size: 0.95rem; }
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.3s;
}
.form-input:focus { outline: none; border-color: var(--secondary); }

/* Session Code */
.session-code {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, var(--bg3), var(--bg2));
    border-radius: 16px;
    margin-bottom: 20px;
    border: 2px solid var(--border);
}

.session-code-value {
    font-size: 2.8rem;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 10px;
    font-family: monospace;
    font-weight: 700;
}

/* Player List */
.player-list { list-style: none; }

.player-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg);
    border-radius: 12px;
    margin-bottom: 10px;
    border-right: 4px solid var(--border);
    transition: all 0.3s;
}

.player-item.ready { border-right-color: var(--success); background: rgba(78, 205, 196, 0.1); }
.player-item.host { background: rgba(233, 69, 96, 0.1); }

.player-name { flex: 1; font-weight: 500; }
.player-status { font-size: 0.9rem; color: var(--text2); }
.player-status.ready { color: var(--success); font-weight: 600; }

/* Timer */
.timer-display {
    text-align: center;
    padding: 20px;
    background: var(--bg);
    border-radius: 16px;
    border: 2px solid var(--border);
}

.timer-value {
    font-size: 3rem;
    font-family: monospace;
    font-weight: 700;
    color: var(--success);
}

.timer-value.warning { color: var(--warning); animation: pulse 1s infinite; }
.timer-value.danger { color: var(--danger); animation: pulse 0.5s infinite; }

@keyframes pulse { 50% { opacity: 0.6; } }

/* Game Layout */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

@media (max-width: 900px) {
    .game-layout { grid-template-columns: 1fr; }
}

/* Role Badge */
.role-badge {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    background: rgba(78, 205, 196, 0.2);
    color: var(--secondary);
    margin-left: 10px;
}

.difficulty-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-left: 10px;
}

.difficulty-badge.easy { background: rgba(78, 205, 196, 0.2); color: var(--success); }
.difficulty-badge.medium { background: rgba(255, 230, 109, 0.2); color: var(--warning); }
.difficulty-badge.hard { background: rgba(233, 69, 96, 0.2); color: var(--danger); }

/* Clues */
.clue-list { list-style: none; }

.clue-item {
    padding: 14px 18px;
    background: var(--bg);
    border-radius: 12px;
    margin-bottom: 10px;
    border-right: 3px solid var(--secondary);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Answer Options */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.option-btn {
    padding: 18px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1rem;
    font-weight: 500;
}

.option-btn:hover { border-color: var(--secondary); transform: translateY(-2px); }
.option-btn.selected { 
    border-color: var(--primary); 
    background: rgba(233, 69, 96, 0.15);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

/* Chat */
.chat-box {
    height: 280px;
    overflow-y: auto;
    background: var(--bg);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.chat-msg {
    padding: 10px 12px;
    margin-bottom: 10px;
    background: rgba(58, 58, 92, 0.5);
    border-radius: 10px;
}

.chat-sender { font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.chat-text { color: var(--text2); line-height: 1.5; }

.chat-input-row {
    display: flex;
    gap: 10px;
}

.chat-input-row input { flex: 1; }
.chat-input-row button { padding: 12px 20px; }

/* End Report */
.end-report { text-align: center; padding: 40px 20px; }

.end-state {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 25px;
}

.end-state.success { color: var(--success); }
.end-state.partial { color: var(--warning); }
.end-state.failure { color: var(--danger); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin: 30px 0;
}

.stat-item {
    background: var(--bg);
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.stat-value { font-size: 2rem; color: var(--secondary); font-weight: 700; }
.stat-label { font-size: 0.9rem; color: var(--text2); margin-top: 5px; }

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 28px;
    border-radius: 14px;
    z-index: 1000;
    animation: slideDown 0.3s ease;
    font-weight: 500;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.notification.success { background: var(--success); color: var(--bg); }
.notification.error { background: var(--danger); color: white; }
.notification.warning { background: var(--warning); color: var(--bg); }

/* Quick Actions */
.quick-actions {
    display: grid;
    gap: 10px;
}

.quick-btn {
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.quick-btn:hover { 
    border-color: var(--secondary); 
    background: rgba(78, 205, 196, 0.1);
}

/* Hint Box */
.hint-box {
    margin-top: 20px;
    padding: 16px 20px;
    background: rgba(255, 230, 109, 0.1);
    border-radius: 12px;
    border-right: 4px solid var(--warning);
}

.hint-box .hint-title {
    color: var(--warning);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1rem;
}

.hint-box .hint-text {
    color: var(--text2);
    line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text2); }

/* Roles Grid */
.roles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.role-card {
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
    border-right: 4px solid;
}

.role-card .role-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 6px;
}

.role-card .role-desc {
    font-size: 0.9rem;
    color: var(--text2);
}
