/* =====================================================
   MAGNOM — استایل اصلی (تم روشن، RTL فارسی)
   ===================================================== */

:root {
    --bg: #eef2f7;
    --bg2: #e4eaf3;
    --panel: #ffffff;
    --panel2: #f7fafd;
    --border: #dbe4ee;
    --text: #17233b;
    --muted: #5b6b85;
    --accent: #0891b2;
    --accent2: #7c3aed;
    --danger: #dc2626;
    --success: #16a34a;
    --warn: #b45309;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(23, 35, 59, .08);
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(180deg, var(--bg), var(--bg2));
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .85rem; }

/* ---------- آیکون‌های SVG ---------- */
/* هر SVG درون‌خطی بدون اندازه صریح = اندازه فونت (آیکون‌های تزریق‌شده از JS) */
svg:not([width]):not([height]) { width: 1.1em; height: 1.1em; }
[data-icon] {
    display: inline-flex; align-items: center; justify-content: center;
    vertical-align: -0.18em; line-height: 0; flex-shrink: 0;
}
[data-icon] svg, .f-actions [data-icon] svg { width: 1.15em; height: 1.15em; }
.hero-features [data-icon] svg { width: 1.2rem; height: 1.2rem; }
.mode-icon { display: flex; }
.mode-icon[data-icon], .mode-icon [data-icon] svg { width: 2.4rem; height: 2.4rem; }
.e-icon { display: inline-flex; }
.e-icon svg { width: 1.2rem; height: 1.2rem; }
.rooms-head [data-icon] svg, .friends-card h4 [data-icon] svg,
.top5 h4 [data-icon] svg, .wide-card h2 [data-icon] svg,
.overlay h2 [data-icon] svg { width: 1.3em; height: 1.3em; }
#hitmarker svg { width: 1.3em; height: 1.3em; }
.fr-title [data-icon] svg { width: 1em; height: 1em; }
.rooms-list .muted [data-icon] svg { width: 1em; height: 1em; }

/* دات‌های وضعیت و تیم */
.st-dot, .tdot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    vertical-align: middle; margin-left: 3px; line-height: 0;
}
.st-dot.on { background: var(--success); }
.st-dot.off { background: #94a3b8; }
.tdot.blue { background: #2563eb; }
.tdot.red { background: #dc2626; }

/* ---------- پس‌زمینه متحرک ---------- */
.bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(8, 145, 178, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 145, 178, .07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
    animation: gridMove 24s linear infinite;
}
@keyframes gridMove {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 44px, 44px 0; }
}
.bg-glow {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(600px 400px at 15% 20%, rgba(8, 145, 178, .12), transparent 60%),
        radial-gradient(700px 500px at 85% 75%, rgba(124, 58, 237, .10), transparent 60%);
}

/* ---------- هدر ---------- */
.topbar {
    position: relative; z-index: 5;
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 34px;
}
.logo {
    font-size: 1.7rem; font-weight: 900; letter-spacing: 1px;
    color: var(--text); text-decoration: none;
}
.logo span { color: var(--accent); }
.topnav { display: flex; gap: 20px; align-items: center; }
.topnav a {
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
    transition: color .2s;
}
.topnav a:hover { color: var(--accent); }

/* ---------- دکمه‌ها ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: 12px;
    padding: 12px 26px; font-family: inherit; font-size: 1rem; font-weight: 700;
    cursor: pointer; text-decoration: none; transition: all .18s ease;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff; box-shadow: 0 6px 22px rgba(8, 145, 178, .35);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(8, 145, 178, .5); }
.btn-ghost {
    background: rgba(23, 35, 59, .04);
    border-color: var(--border); color: var(--text);
}
.btn-ghost:hover { background: rgba(23, 35, 59, .08); border-color: var(--accent); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 16px; font-size: .85rem; }

/* ---------- کارت ---------- */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* =====================================================
   صفحه ورود
   ===================================================== */
.landing-main {
    position: relative; z-index: 2;
    display: flex; gap: 60px; align-items: center; justify-content: center;
    padding: 40px 6vw 60px; flex-wrap: wrap; min-height: calc(100vh - 170px);
}
.hero { max-width: 560px; }
.hero-title {
    font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 900; line-height: 1.4;
}
.hero-title em {
    font-style: normal;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 18px; color: var(--muted); font-size: 1.05rem; line-height: 1.9; }
.hero-features {
    margin-top: 26px; list-style: none;
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.hero-features li {
    background: rgba(255, 255, 255, .7);
    border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 16px; font-size: .9rem; font-weight: 600;
    box-shadow: 0 3px 12px rgba(23, 35, 59, .05);
}

.auth-card {
    width: 400px; max-width: 92vw;
    background: var(--panel);
    border: 1px solid var(--border); border-radius: 18px;
    box-shadow: var(--shadow); padding: 10px 26px 26px;
}
.auth-tabs { display: flex; gap: 6px; margin: 12px 0 18px; background: rgba(23, 35, 59, .06); padding: 6px; border-radius: 12px; }
.auth-tab {
    flex: 1; padding: 10px; border: 0; border-radius: 9px;
    background: transparent; color: var(--muted); font-family: inherit;
    font-weight: 700; font-size: .95rem; cursor: pointer; transition: all .2s;
}
.auth-tab.active { background: var(--accent); color: #fff; }
.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }
.auth-form label { display: flex; flex-direction: column; gap: 7px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.auth-form input, .auth-form select {
    background: #fbfdff; border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px; color: var(--text);
    font-family: inherit; font-size: .95rem; outline: none; transition: border-color .2s;
}
.auth-form input:focus { border-color: var(--accent); }
.form-error { color: var(--danger); font-size: .85rem; min-height: 1.2em; font-weight: 600; }

.skin-picker { display: flex; gap: 10px; padding: 6px 0; }
.skin-dot {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--c); border: 3px solid transparent; cursor: pointer;
    transition: transform .15s, border-color .15s; box-shadow: 0 2px 8px color-mix(in srgb, var(--c) 55%, transparent);
}
.skin-dot:hover { transform: scale(1.12); }
.skin-dot.active { border-color: var(--text); }

.footer {
    position: relative; z-index: 2; text-align: center;
    color: var(--muted); font-size: .8rem; padding: 20px; direction: ltr;
}

/* =====================================================
   منوی اصلی
   ===================================================== */
.menu-main {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: 290px 1fr 280px;
    gap: 24px; padding: 20px 4vw 50px; max-width: 1400px; margin: 0 auto;
    align-items: start;
}
@media (max-width: 1100px) { .menu-main { grid-template-columns: 1fr; } }

/* ستون چپ: پروفایل + دوستان */
.col-left { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* پروفایل */
.profile-card { text-align: center; }
.avatar {
    --c: #0891b2;
    width: 84px; height: 84px; margin: 0 auto 12px;
    border-radius: 18px; background: var(--c);
    position: relative; box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 40%, transparent);
    image-rendering: pixelated;
}
.avatar.big { width: 110px; height: 110px; }
.avatar-face {
    position: absolute; inset: 0;
    background-image:
        radial-gradient(#17233b 42%, transparent 46%),
        radial-gradient(#17233b 42%, transparent 46%),
        linear-gradient(#17233b 0 0);
    background-size: 12px 12px, 12px 12px, 36px 7px;
    background-position: 30% 34%, 70% 34%, 50% 62%;
    background-repeat: no-repeat;
}
.profile-name { font-size: 1.25rem; font-weight: 900; }
.lvl-badge {
    display: inline-block; margin: 8px 0;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff; border-radius: 999px; padding: 4px 14px;
    font-size: .8rem; font-weight: 800;
}
.xp-bar { height: 9px; border-radius: 6px; background: rgba(23, 35, 59, .12); overflow: hidden; margin-top: 6px; }
.xp-fill {
    height: 100%; width: 0; border-radius: 6px;
    background: linear-gradient(90deg, #06b6d4, #7c3aed);
    transition: width .6s ease;
}
.xp-text { font-size: .75rem; color: var(--muted); margin-top: 6px; direction: ltr; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.profile-stats div {
    background: rgba(23, 35, 59, .05); border-radius: 10px; padding: 10px 4px;
    display: flex; flex-direction: column; gap: 3px;
}
.profile-stats b { font-size: 1.1rem; }
.profile-stats span { font-size: .72rem; color: var(--muted); }

/* مودهای بازی */
.play-area { display: flex; flex-direction: column; gap: 22px; }
.play-title { font-size: 1.6rem; font-weight: 900; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .mode-grid { grid-template-columns: 1fr; } }
.mode-card {
    font-family: inherit; text-align: right; cursor: pointer;
    background: var(--panel);
    border: 1px solid var(--border); border-radius: 16px;
    padding: 26px; color: var(--text); transition: all .2s ease;
    position: relative; overflow: hidden;
    box-shadow: var(--shadow);
}
.mode-card::after {
    content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .25s;
    background: radial-gradient(400px 200px at 20% 0%, rgba(8, 145, 178, .10), transparent);
}
.mode-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.mode-card:hover::after { opacity: 1; }
.mode-icon { font-size: 2.2rem; }
.mode-card h3 { margin: 10px 0 6px; font-size: 1.25rem; font-weight: 900; }
.mode-card p { color: var(--muted); font-size: .88rem; }
.mode-bots:hover { border-color: var(--accent2); }
.server-status {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 14px; font-size: .8rem; font-weight: 700; color: var(--muted);
}
.server-status .dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--warn); display: inline-block;
}
.server-status.online { color: var(--success); }
.server-status.online .dot { background: var(--success); box-shadow: 0 0 8px rgba(22, 163, 74, .6); animation: pulse 1.6s infinite; }
.server-status.offline { color: var(--danger); }
.server-status.offline .dot { background: var(--danger); }
.server-status.offline-ok { color: var(--success); }
.server-status.offline-ok .dot { background: var(--success); }
@keyframes pulse { 50% { opacity: .4; } }

/* تنظیمات */
.settings-row h4 { margin-bottom: 14px; }
.setting-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; flex-wrap: wrap; }
.setting-item label { font-size: .9rem; color: var(--muted); font-weight: 600; }
.setting-item input[type=range] { accent-color: var(--accent); width: 180px; }
.setting-item select {
    background: #fbfdff; color: var(--text); border: 1px solid var(--border);
    border-radius: 9px; padding: 8px 14px; font-family: inherit;
}

/* ---------- لیست بازی‌های فعال ---------- */
.rooms-card { margin-top: 22px; }
.rooms-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.room-create {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
    padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.room-create input {
    flex: 1; min-width: 120px;
    background: #fbfdff; border: 1px solid var(--border);
    border-radius: 9px; padding: 9px 12px; color: var(--text);
    font-family: inherit; font-size: .88rem; outline: none;
}
.room-create input:focus { border-color: var(--accent); }
.room-create select {
    background: #fbfdff; color: var(--text);
    border: 1px solid var(--border); border-radius: 9px;
    padding: 9px 10px; font-family: inherit; font-size: .85rem;
}
.rooms-list { display: flex; flex-direction: column; gap: 10px; }
.room-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: rgba(23, 35, 59, .04); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 16px;
    transition: border-color .2s;
}
.room-row:hover { border-color: var(--accent); }
.room-info { min-width: 0; }
.room-title { font-weight: 800; font-size: .95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-meta { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.room-meta .has-space { color: var(--success); font-weight: 700; }
.room-meta .full { color: var(--danger); font-weight: 700; }
.room-top { font-size: .75rem; color: var(--muted); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-badge {
    font-size: .68rem; font-weight: 800; padding: 2px 10px; border-radius: 999px;
}
.mode-badge.ffa { background: rgba(8, 145, 178, .12); color: #0e7490; }
.mode-badge.tdm { background: rgba(124, 58, 237, .12); color: #6d28d9; }

/* ---------- دوستان ---------- */
.friends-card h4 { margin-bottom: 14px; }
.friend-add { display: flex; gap: 8px; }
.friend-add input {
    flex: 1; min-width: 0;
    background: #fbfdff; border: 1px solid var(--border);
    border-radius: 9px; padding: 9px 12px; color: var(--text);
    font-family: inherit; font-size: .88rem; outline: none;
}
.friend-add input:focus { border-color: var(--accent); }
.friend-requests { margin-top: 10px; }
.fr-title { font-size: .8rem; color: var(--warn); font-weight: 700; margin-bottom: 8px; }
.friends-list { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.friend-row {
    display: flex; align-items: center; gap: 10px;
    background: rgba(23, 35, 59, .04); border-radius: 10px; padding: 8px 12px;
}
.friend-row.pending { opacity: .65; }
.f-chip {
    width: 14px; height: 14px; border-radius: 5px; flex-shrink: 0;
    background: var(--c); box-shadow: 0 1px 5px color-mix(in srgb, var(--c) 50%, transparent);
}
.f-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.f-name { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-sub { font-size: .7rem; }
.f-sub.on { color: var(--success); }
.f-sub.off { color: var(--muted); }
.f-actions { display: flex; gap: 6px; flex-shrink: 0; }
.f-actions .btn { padding: 5px 12px; font-size: .75rem; }

/* ---------- توست ---------- */
.toast {
    position: fixed; top: 18px; left: 18px; z-index: 1000;
    background: var(--panel);
    border: 1px solid var(--accent); border-radius: 14px;
    padding: 14px 20px; max-width: 380px;
    box-shadow: 0 14px 44px rgba(23, 35, 59, .18), 0 0 0 4px rgba(8, 145, 178, .07);
    animation: toastIn .3s ease-out;
    font-size: .92rem;
}
.toast.toast-error { border-color: var(--danger); }
.toast b { color: var(--accent); }
@keyframes toastIn {
    from { transform: translateY(-16px); opacity: 0; }
}
.toast-invite { display: flex; flex-direction: column; gap: 10px; }
.toast-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* برترین‌ها */
.top5 h4 { margin-bottom: 12px; }
.top5-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.top5-list li {
    display: flex; align-items: center; gap: 10px;
    background: rgba(23, 35, 59, .04); border-radius: 10px; padding: 9px 12px; font-size: .88rem;
}
.top5-list .rank {
    width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
    background: var(--accent); color: #fff; font-weight: 900;
    display: inline-flex; align-items: center; justify-content: center; font-size: .78rem;
}
.top5-list .t-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top5-list .t-kills { color: var(--muted); font-size: .78rem; }

/* =====================================================
   صفحات عمومی (جدول امتیازات / پروفایل)
   ===================================================== */
.page-main {
    position: relative; z-index: 2;
    max-width: 1000px; margin: 0 auto; padding: 20px 4vw 60px;
}
.wide-card h2 { margin-bottom: 12px; }
.tab-row { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
    padding: 8px 22px; border-radius: 999px; text-decoration: none;
    background: rgba(23, 35, 59, .05); color: var(--muted); font-weight: 700; font-size: .88rem;
    border: 1px solid var(--border); transition: all .2s;
}
.tab.active, .tab:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.lb-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.lb-table th, .lb-table td { padding: 11px 12px; text-align: center; }
.lb-table th { color: var(--muted); font-size: .8rem; border-bottom: 1px solid var(--border); }
.lb-table td { border-bottom: 1px solid rgba(219, 228, 238, .7); }
.lb-table tr.me td { background: rgba(8, 145, 178, .08); }
.lb-table .rank { font-weight: 900; color: var(--accent); }
.lb-table .p-name { font-weight: 700; text-align: right; }
.skin-chip {
    display: inline-block; width: 12px; height: 12px; border-radius: 4px;
    background: var(--c); margin-left: 8px; vertical-align: middle;
}
.profile-page { text-align: center; }
.profile-page h2 { margin-top: 14px; }
.stat-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0;
}
@media (max-width: 700px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-box {
    background: rgba(23, 35, 59, .04); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px 8px;
    display: flex; flex-direction: column; gap: 4px;
}
.stat-box b { font-size: 1.4rem; color: var(--accent); }
.stat-box span { font-size: .78rem; color: var(--muted); }

/* =====================================================
   HUD بازی (شیشه روشن روی نقشه روشن)
   ===================================================== */
#gameCanvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: inherit; }

/* کراسهر — سفید با دورخط تیره برای دیده‌شدن روی نقشه روشن */
#crosshair {
    position: absolute; left: 50%; top: 50%; width: 34px; height: 34px;
    transform: translate(-50%, -50%);
}
#crosshair .ch-dot {
    position: absolute; left: 50%; top: 50%; width: 4px; height: 4px;
    background: #fff; border-radius: 50%; transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1.5px rgba(15, 23, 42, .75), 0 0 5px rgba(15, 23, 42, .5);
}
#crosshair .ch-line { position: absolute; background: #fff; box-shadow: 0 0 0 1.5px rgba(15, 23, 42, .65), 0 0 5px rgba(15, 23, 42, .4); transition: all .1s; }
.ch-t { left: 50%; top: 2px;  width: 2px; height: 8px; transform: translateX(-50%); }
.ch-b { left: 50%; bottom: 2px; width: 2px; height: 8px; transform: translateX(-50%); }
.ch-l { left: 2px; top: 50%; width: 8px; height: 2px; transform: translateY(-50%); }
.ch-r { right: 2px; top: 50%; width: 8px; height: 2px; transform: translateY(-50%); }

/* هیت‌مارکر */
#hitmarker {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(1.4);
    color: #17233b; font-size: 1.5rem; font-weight: 900; opacity: 0;
    text-shadow: 0 0 5px rgba(255, 255, 255, .95), 0 0 2px #fff;
}
#hitmarker.show { animation: hitPop .18s ease-out; }
#hitmarker.head { color: var(--danger); }
@keyframes hitPop {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1.7); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* پاپ‌آپ دمیج */
#damagePopups { position: absolute; inset: 0; overflow: hidden; }
.dmg-pop {
    position: absolute; left: 53%; top: 47%;
    color: #92400e; font-weight: 900; font-size: 1.1rem;
    text-shadow: 0 1px 3px rgba(255, 255, 255, .9), 0 0 6px rgba(255, 255, 255, .7);
    animation: dmgFloat .7s ease-out forwards;
}
.dmg-pop.hs { color: var(--danger); font-size: 1.3rem; }
@keyframes dmgFloat {
    to { transform: translateY(-46px); opacity: 0; }
}

/* وینیت دمیج */
#dmgVignette {
    position: absolute; inset: 0; opacity: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(200, 20, 20, .5) 100%);
    transition: opacity .25s;
}
#dmgDirection {
    position: absolute; left: 50%; top: 50%; width: 140px; height: 140px;
    margin: -70px; opacity: 0; pointer-events: none;
}

/* نوار بالا */
#hudTop {
    position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
    text-align: center; direction: ltr;
}
#matchTimer {
    font-size: 1.7rem; font-weight: 900; letter-spacing: 2px;
    background: rgba(255, 255, 255, .8); border-radius: 12px; padding: 4px 22px;
    border: 1px solid rgba(23, 35, 59, .12);
    color: var(--text);
    box-shadow: 0 4px 14px rgba(23, 35, 59, .1);
}
#matchTimer.ending { color: var(--danger); animation: pulse 1s infinite; }
#matchMode { font-size: .75rem; color: var(--muted); margin-top: 5px; font-weight: 600;
    text-shadow: 0 1px 3px rgba(255, 255, 255, .9); }

/* امتیاز تیمی در HUD */
#teamScores {
    position: absolute; top: 74px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px; direction: rtl;
}
.ts {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, .8); border-radius: 10px; padding: 4px 14px;
    border: 1px solid rgba(23, 35, 59, .12);
    box-shadow: 0 4px 14px rgba(23, 35, 59, .1);
}
.ts b { font-size: 1.25rem; font-weight: 900; }
.ts span { font-size: .72rem; font-weight: 700; }
.ts-blue b, .ts-blue span { color: #2563eb; }
.ts-red b, .ts-red span { color: #dc2626; }
.ts-vs { color: var(--muted); font-weight: 900; font-size: .8rem; }

/* کیل‌فید */
#killfeed {
    position: absolute; top: 18px; right: 18px;
    display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
.kf-item {
    background: rgba(255, 255, 255, .85); border: 1px solid rgba(23, 35, 59, .12);
    border-radius: 9px; padding: 6px 14px; font-size: .85rem; font-weight: 700;
    color: var(--text);
    animation: kfIn .25s ease-out;
}
.kf-item .k { color: #0e7490; }
.kf-item .v { color: var(--danger); }
.kf-item .w { color: var(--muted); font-size: .75rem; }
.kf-item.me { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(8, 145, 178, .15); }
@keyframes kfIn { from { transform: translateX(30px); opacity: 0; } }

/* رنگ تیم در کیل‌فید/چت */
.kf-item .k.team-blue, .chat-msg b.team-blue { color: #2563eb; }
.kf-item .k.team-red, .chat-msg b.team-red { color: #dc2626; }
.kf-item .v.team-blue { color: #1d4ed8; }
.kf-item .v.team-red { color: #b91c1c; }

/* نوار پایین */
#hudBottom {
    position: absolute; bottom: 24px; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: flex-end;
    padding: 0 34px;
}
#healthBox { display: flex; align-items: center; gap: 12px; }
#healthBar {
    width: 230px; height: 16px; border-radius: 9px; overflow: hidden;
    background: rgba(23, 35, 59, .15); border: 1px solid rgba(23, 35, 59, .18);
    transform: skewX(-12deg);
}
#healthFill {
    height: 100%; width: 100%;
    background: linear-gradient(90deg, #16a34a, #06b6d4);
    transition: width .15s;
}
#healthFill.low { background: linear-gradient(90deg, #dc2626, #ea580c); }
#healthNum { font-size: 1.6rem; font-weight: 900; color: var(--text);
    text-shadow: 0 1px 4px rgba(255, 255, 255, .95), 0 0 8px rgba(255, 255, 255, .8); }
#ammoBox { text-align: center; direction: ltr;
    background: rgba(255, 255, 255, .8); padding: 8px 20px; border-radius: 12px;
    border: 1px solid rgba(23, 35, 59, .12);
    box-shadow: 0 4px 14px rgba(23, 35, 59, .1);
}
#ammoNum { font-size: 2rem; font-weight: 900; color: var(--text); }
#ammoNum span { font-size: 1.1rem; color: var(--muted); }
#ammoNum.reloading { color: var(--warn); }
#weaponName { font-size: .78rem; color: #0e7490; font-weight: 800; letter-spacing: 1px; }

/* اسلات‌های اسلحه */
#weaponSlots {
    position: absolute; bottom: 90px; right: 34px;
    display: flex; flex-direction: column; gap: 6px;
}
.wslot {
    background: rgba(255, 255, 255, .8); border: 1px solid rgba(23, 35, 59, .12);
    border-radius: 9px; padding: 5px 14px; font-size: .8rem; font-weight: 700;
    color: var(--muted); display: flex; gap: 10px; align-items: center; direction: ltr;
    min-width: 120px;
}
.wslot.active { border-color: var(--accent); color: var(--text); background: rgba(8, 145, 178, .14); }
.wslot .key {
    background: rgba(23, 35, 59, .1); border-radius: 5px;
    width: 20px; height: 20px; font-size: .72rem;
    display: inline-flex; align-items: center; justify-content: center;
}

/* تجهیزات پرتابی (نارنجک/سموک) */
#equipBox {
    position: absolute; bottom: 24px; right: 34px;
    display: flex; gap: 8px;
}
.equip {
    display: flex; align-items: center; gap: 7px;
    background: rgba(255, 255, 255, .8); border: 1px solid rgba(23, 35, 59, .12);
    border-radius: 10px; padding: 7px 12px;
    font-size: .85rem; font-weight: 800;
    box-shadow: 0 4px 14px rgba(23, 35, 59, .1);
    transition: all .2s;
}
.equip .e-count { color: var(--text); direction: ltr; }
.equip .e-key {
    background: rgba(8, 145, 178, .15); border-radius: 5px;
    width: 18px; height: 18px; font-size: .68rem;
    display: inline-flex; align-items: center; justify-content: center;
    color: #0e7490;
}
.equip.empty { opacity: .4; filter: grayscale(1); }

/* اسکوربورد */
#scoreboard {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, .94); border: 1px solid var(--border);
    border-radius: 16px; padding: 22px 30px; min-width: 420px;
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 60px rgba(23, 35, 59, .2);
    color: var(--text);
}
#scoreboard h3 { text-align: center; margin-bottom: 14px; }
#scoreboard table { width: 100%; border-collapse: collapse; }
#scoreboard th, #scoreboard td { padding: 7px 16px; text-align: center; font-size: .9rem; }
#scoreboard th { color: var(--muted); border-bottom: 1px solid var(--border); }
#scoreboard tr.me td { color: #0e7490; font-weight: 800; }
#scoreboard td:first-child { text-align: right; font-weight: 700; }
#scoreboard tr.dead td { opacity: .5; }

/* هدر تیم در اسکوربورد */
#scoreboard tr.sb-team td {
    text-align: right; font-weight: 900; font-size: .85rem;
    padding: 8px 16px 4px;
}
#scoreboard tr.sb-blue td { color: #2563eb; }
#scoreboard tr.sb-red td { color: #dc2626; }

/* چت */
#chatBox {
    position: absolute; bottom: 110px; left: 34px; width: 300px;
    pointer-events: auto; direction: rtl;
}
#chatLog { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; max-height: 180px; overflow-y: auto; }
.chat-msg {
    background: rgba(255, 255, 255, .85); border: 1px solid rgba(23, 35, 59, .08);
    border-radius: 8px; padding: 5px 10px;
    font-size: .8rem; width: fit-content; max-width: 100%; word-break: break-word;
    color: var(--text);
}
.chat-msg b { color: #0e7490; margin-left: 6px; }
.chat-msg.system { color: var(--warn); font-size: .75rem; }
#chatInput {
    width: 100%; background: rgba(255, 255, 255, .92); border: 1px solid var(--accent);
    border-radius: 9px; color: var(--text); padding: 8px 12px; font-family: inherit; outline: none;
}

/* اورلی‌ها */
.overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 14px;
    background: rgba(238, 242, 247, .82); backdrop-filter: blur(6px);
    pointer-events: auto; text-align: center; z-index: 20;
}
.overlay h2 { font-size: 2.2rem; font-weight: 900; color: var(--text); }
.overlay-actions { display: flex; gap: 14px; margin-top: 10px; }
.pause-hint { color: var(--muted); font-size: .82rem; margin-top: 18px; }
#clickToPlay { background: rgba(238, 242, 247, .6); }
#ctpTitle { font-size: 3.4rem; letter-spacing: 3px; color: var(--accent);
    text-shadow: 0 4px 24px rgba(8, 145, 178, .35); }
#respawnCount { font-size: 3.4rem; font-weight: 900; color: var(--danger); }
#killerInfo { color: var(--muted); }
.end-table { min-width: 380px; border-collapse: collapse; }
.end-table td { padding: 6px 18px; border-bottom: 1px solid var(--border); font-size: .92rem; }
.end-table tr:first-child td { color: var(--warn); font-weight: 900; }

/* اسکرول‌بار */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-thumb { background: #c3cfdd; border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }
