/* مِكس v3: شات عام مع بحث وتصفية بالمدينة ومنشورات اللاعبين */
#feed > :not(#mix-v3-root){display:none!important}
#mix-v3-root{--mx-bg:#10232c;--mx-surface:#152d37;--mx-surface-2:#1a3641;--mx-line:rgba(154,210,191,.18);--mx-gold:#e6cf94;--mx-gold-soft:#f6e9c0;--mx-mint:#7ee6bb;--mx-text:#f4f1e8;--mx-muted:#9fb5ad;--mx-cta:linear-gradient(135deg,#c2b0f7,#9a85e6);font-family:"IBM Plex Sans Arabic","Tajawal",system-ui,sans-serif;color:var(--mx-text)}
#mix-v3-root *,#mx-sheet-host *{box-sizing:border-box;letter-spacing:0}
#mix-v3-root h2,#mix-v3-root h3,#mix-v3-root p{margin:0}
#mix-v3-root button{font:inherit;color:inherit;cursor:pointer}
#mix-v3-root svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.mx-page{display:grid;gap:12px;max-width:620px;margin:0 auto;padding:4px 2px 120px}
.mx-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.mx-head h2{font-size:28px;font-weight:800;color:var(--mx-gold-soft);line-height:1.1}
.mx-head span{font-size:12.5px;color:var(--mx-muted)}

/* البحث */
.mx-search{display:flex;align-items:center;gap:10px;min-height:48px;padding:0 14px;border:1px solid var(--mx-line);border-radius:16px;background:var(--mx-surface-2);color:var(--mx-gold)}
.mx-search:focus-within{border-color:rgba(230,207,148,.6);box-shadow:0 0 0 2px rgba(230,207,148,.18)}
.mx-search input{flex:1;min-width:0;border:0;background:transparent;color:var(--mx-text);font:inherit;font-size:14.5px;outline:0}
.mx-search input::placeholder{color:#6f8781}

/* المدن */
.mx-chips{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.mx-chips::-webkit-scrollbar{display:none}
.mx-chip{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 14px;border:1px solid var(--mx-line);border-radius:999px;background:var(--mx-surface);font-size:13.5px;font-weight:700;white-space:nowrap;flex:none}
.mx-chip small{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:rgba(255,255,255,.08);font-size:11px;color:var(--mx-muted);font-weight:700}
.mx-chip em{font-style:normal;font-size:10.5px;color:var(--mx-mint)}
.mx-chip.is-on{border-color:rgba(230,207,148,.7);background:linear-gradient(135deg,#25454f,#173038);color:var(--mx-gold-soft)}
.mx-chip.is-on small{background:rgba(230,207,148,.2);color:var(--mx-gold-soft)}

/* المنشورات */
.mx-list{display:grid;gap:10px}
.mx-post{display:grid;grid-template-columns:48px minmax(0,1fr);gap:12px;padding:12px;border:1px solid var(--mx-line);border-radius:18px;background:var(--mx-surface)}
.mx-post.is-mine{border-color:rgba(230,207,148,.35);background:linear-gradient(135deg,#183a43,#142f38)}
.mxp-avatar{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;overflow:hidden;background:radial-gradient(circle at 30% 25%,#2a5260,#12303a 75%);border:1.5px solid rgba(230,207,148,.55);color:var(--mx-gold-soft);font-size:19px;font-weight:800;flex:none}
.mxp-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.mxp-avatar.is-large{width:64px;height:64px;font-size:25px}
.mx-post-body{display:grid;gap:6px;min-width:0}
.mx-post-top{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px}
.mx-post-top b{font-size:15.5px;font-weight:800;color:var(--mx-gold-soft)}
.mx-city{display:inline-flex;align-items:center;gap:3px;padding:2px 9px 2px 8px;border-radius:999px;background:rgba(126,230,187,.1);color:var(--mx-mint);font-size:11.5px;font-weight:700}
.mx-city svg{width:12px;height:12px}
.mx-post-top time{margin-inline-start:auto;font-size:11px;color:var(--mx-muted);white-space:nowrap}
.mx-post p{font-size:14.5px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere}
.mx-post-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:2px}
.mx-phone{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:0 12px;border:1px solid rgba(230,207,148,.45);border-radius:12px;background:rgba(230,207,148,.08);color:var(--mx-gold-soft);font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:.04em}
.mx-phone b{padding:3px 9px;border-radius:8px;background:var(--mx-cta);color:#20163f;font-size:11.5px;letter-spacing:0}
button.mx-phone:hover{border-color:var(--mx-gold)}
.mx-phone.is-own{border-style:dashed;color:var(--mx-muted)}
.mx-del{display:grid;place-items:center;width:36px;height:36px;margin-inline-start:auto;border:1px solid var(--mx-line);border-radius:10px;background:transparent;color:var(--mx-muted)}
.mx-del:hover{color:#f3b3b3;border-color:rgba(240,120,120,.5)}
.mxp-empty{display:grid;gap:6px;justify-items:center;padding:28px 16px;border:1px dashed rgba(230,207,148,.35);border-radius:18px;text-align:center}
.mxp-empty b{font-size:16px;color:var(--mx-gold-soft)}
.mxp-empty span{font-size:13px;color:var(--mx-muted);line-height:1.7}

/* زر + */
.mx-fab{position:fixed;z-index:30;bottom:26px;inset-inline-start:max(18px,calc(50% - 290px));display:grid;place-items:center;width:58px;height:58px;border:0;border-radius:50%;background:var(--mx-cta);color:#20163f;box-shadow:0 10px 26px rgba(0,0,0,.45),0 0 0 4px rgba(194,176,247,.18)}
.mx-fab svg{width:26px;height:26px;stroke-width:2.6}
.mx-fab:active{transform:scale(.95)}

/* نافذة منشور جديد */
.mxp-backdrop{position:fixed;inset:0;z-index:9998;background:rgba(3,10,13,.62);backdrop-filter:blur(2px)}
.mx-sheet{position:fixed;z-index:9999;inset-inline:0;bottom:0;max-width:620px;margin:0 auto;display:grid;gap:12px;padding:10px 18px calc(22px + env(safe-area-inset-bottom,0px));border:1px solid rgba(230,207,148,.3);border-bottom:0;border-radius:26px 26px 0 0;background:linear-gradient(180deg,#1a3641,#10262e);box-shadow:0 -18px 50px rgba(0,0,0,.5);transform:translateY(105%);transition:transform .32s cubic-bezier(.2,.9,.3,1);color:var(--mx-text);font-family:"IBM Plex Sans Arabic","Tajawal",system-ui,sans-serif;max-height:92dvh;overflow-y:auto}
.mx-sheet.is-in{transform:translateY(0)}
.mx-sheet button{font:inherit;color:inherit;cursor:pointer}
.mx-sheet svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.mx-handle{justify-self:center;width:44px;height:5px;border-radius:999px;background:rgba(255,255,255,.22)}
.mx-sheet-head{display:flex;align-items:center;justify-content:space-between}
.mx-sheet-head h3{margin:0;font-size:19px;font-weight:800;color:var(--mx-gold-soft)}
.mx-icon-btn{display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--mx-line);border-radius:12px;background:rgba(255,255,255,.04)}
.mx-author{display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:center}
.mx-author-info{display:grid;gap:4px}
.mx-author-info b{font-size:17px;font-weight:800;color:var(--mx-gold-soft)}
.mx-author-info small{display:inline-flex;align-items:center;gap:4px;font-size:12.5px;color:var(--mx-mint)}
.mx-author-info svg{width:13px;height:13px}
#mx-text{width:100%;min-height:110px;resize:none;padding:12px 14px;border:1px solid var(--mx-line);border-radius:16px;background:#0c1c22;color:var(--mx-text);font:inherit;font-size:15px;line-height:1.7}
#mx-text:focus{outline:2px solid var(--mx-gold);outline-offset:1px;border-color:transparent}
.mx-counter{margin-top:-6px;text-align:end;font-size:11.5px;color:var(--mx-muted)}
.mx-phone-toggle{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center;padding:12px 14px;border:1px solid var(--mx-line);border-radius:16px;background:rgba(255,255,255,.03);cursor:pointer}
.mx-phone-toggle.is-on{border-color:rgba(230,207,148,.55);background:rgba(230,207,148,.07)}
.mx-phone-toggle input{position:absolute;opacity:0;width:1px;height:1px}
.mx-switch{position:relative;width:46px;height:26px;border-radius:999px;background:rgba(255,255,255,.14);transition:background .2s}
.mx-switch::after{content:"";position:absolute;top:3px;inset-inline-start:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .2s}
.mx-phone-toggle.is-on .mx-switch{background:#7ee6bb}
.mx-phone-toggle.is-on .mx-switch::after{transform:translateX(-20px)}
.mx-phone-toggle input:focus-visible+.mx-switch{outline:2px solid var(--mx-gold);outline-offset:2px}
.mx-phone-toggle input:disabled+.mx-switch{opacity:.4}
.mx-phone-toggle-text{display:grid;gap:2px}
.mx-phone-toggle-text b{font-size:14.5px}
.mx-phone-toggle-text small{font-size:13px;color:var(--mx-muted);text-align:right;letter-spacing:.06em}
.mx-note{margin-top:-4px;font-size:12px;color:var(--mx-muted)}
.mx-publish{min-height:52px;border:0;border-radius:15px;background:var(--mx-cta);color:#20163f;font-size:16px;font-weight:800}
.mx-publish:disabled{opacity:.5}

#mx-toast{position:fixed;z-index:10001;inset-inline:0;bottom:96px;margin:0 auto;width:max-content;max-width:86vw;padding:10px 16px;border-radius:12px;background:#101b1b;border:1px solid #648f84;color:#f5f1e9;font-size:13.5px;opacity:0;pointer-events:none;transition:opacity .18s}
#mx-toast.is-on{opacity:1}
body:has(.mx-sheet) .floating-home{display:none!important}
#mix-v3-root button:focus-visible,.mx-sheet button:focus-visible{outline:2px solid var(--mx-gold);outline-offset:2px}
@media(prefers-reduced-motion:reduce){.mx-sheet{transition:none}}
.mx-counter{direction:ltr;text-align:left}

/* صور المنشورات والرفع */
.mx-photo{display:block;width:100%;padding:0;border:1px solid var(--mx-line);border-radius:14px;overflow:hidden;background:#0c1c22;min-height:120px;position:relative}
.mx-photo img{display:block;width:100%;max-height:360px;object-fit:cover}
.mx-photo img:not([src]){min-height:160px}
.mx-photo.is-broken::after{content:"تعذّر تحميل الصورة";position:absolute;inset:0;display:grid;place-items:center;font-size:12.5px;color:var(--mx-muted)}
.mx-attach{display:grid}
.mx-attach-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;border:1px dashed rgba(230,207,148,.5);border-radius:14px;background:rgba(230,207,148,.06);color:var(--mx-gold-soft);font-weight:700;font-size:14px}
.mx-attach-btn:disabled{opacity:.6}
.mx-attach-preview{position:relative;border-radius:14px;overflow:hidden;border:1px solid rgba(230,207,148,.4)}
.mx-attach-preview img{display:block;width:100%;max-height:200px;object-fit:cover}
.mx-attach-remove{position:absolute;top:8px;inset-inline-end:8px;display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:50%;background:rgba(8,16,20,.75);color:#fff}
.mx-lightbox{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:18px;background:rgba(3,8,10,.92)}
.mx-lightbox img{max-width:100%;max-height:88dvh;border-radius:12px;object-fit:contain}
.mx-lightbox button{position:absolute;top:16px;inset-inline-end:16px}

/* الصور تُعرض كاملة بنسبتها الأصلية (طولية أو عرضية) بلا قص */
.mx-photo{display:grid;place-items:center;min-height:0;background:#0b181d}
.mx-photo img{width:auto;height:auto;max-width:100%;max-height:440px;object-fit:contain;margin:0 auto}
.mx-photo img:not([src]){width:100%;min-height:160px}
.mx-attach-preview{display:grid;place-items:center;background:#0b181d}
.mx-attach-preview img{width:auto;height:auto;max-width:100%;max-height:260px;object-fit:contain}

/* مقاس ثابت لكل المنشورات: الصورة مصغّرة بارتفاع ثابت، وتُكبَّر بالضغط عليها */
.mx-photo{position:relative;display:block;width:100%;height:150px;min-height:0;padding:0;overflow:hidden;background:#0b181d}
.mx-photo img,.mx-photo img:not([src]){position:absolute;inset:0;width:100%;height:100%;max-height:none;min-height:0;object-fit:cover;margin:0}
.mx-photo::after{content:"اضغط للتكبير";position:absolute;inset-inline-end:8px;bottom:8px;padding:3px 10px;border-radius:999px;background:rgba(8,16,20,.7);color:#f4f1e8;font-size:11px;pointer-events:none}
.mx-photo.is-broken::after{content:"تعذّر تحميل الصورة";inset:0;display:grid;place-items:center;background:transparent;font-size:12.5px;color:#9fb5ad;padding:0;border-radius:0}
.mx-attach-preview{display:block;height:150px}
.mx-attach-preview img{width:100%;height:100%;max-height:none;object-fit:contain}

/* ثلاثة خيارات فقط: مدينتك | الأحدث | الشات العام */
.mx-chips{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;overflow:visible;padding:2px 0 4px}
.mx-chip{justify-content:center;gap:6px;min-width:0;padding:0 8px;font-size:13.5px;flex-wrap:nowrap;white-space:nowrap}
.mx-chip em{font-size:10px;padding:1px 6px;border-radius:999px;background:rgba(126,230,187,.14)}
@media(max-width:380px){.mx-chip{font-size:12px;padding:0 4px}.mx-chip em{display:none}}

/* الكاتب (صورة واسم) قابلان للضغط لفتح ملفه */
.mx-author-btn{display:block;align-self:start;padding:0;border:0;background:none;cursor:pointer;border-radius:50%}
.mx-name-btn{padding:0;border:0;background:none;cursor:pointer;font:inherit;font-size:15.5px;font-weight:800;color:var(--mx-gold-soft);text-align:start}
.mx-name-btn:hover{text-decoration:underline}
.mxp-avatar.is-small{width:32px;height:32px;font-size:13px}
.mxp-avatar.is-xl{width:84px;height:84px;font-size:32px}

/* الردود */
.mx-post-foot{flex-wrap:wrap;gap:8px}
.mx-reply-btn{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 12px;border:1px solid var(--mx-line);border-radius:12px;background:rgba(255,255,255,.04);color:var(--mx-muted);font-size:13px;font-weight:700}
.mx-reply-btn svg{width:16px;height:16px}
.mx-reply-btn small{display:grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--mx-mint);color:#0b2a22;font-size:11px;font-weight:800}
.mx-reply-btn.is-on{border-color:rgba(230,207,148,.6);color:var(--mx-gold-soft)}
.mx-replies{display:grid;gap:8px;margin-top:6px;padding-top:10px;border-top:1px solid var(--mx-line)}
.mx-reply-list{display:grid;gap:8px;max-height:320px;overflow-y:auto}
.mx-reply{display:grid;grid-template-columns:32px minmax(0,1fr);gap:8px}
.mx-reply-body{padding:8px 10px;border-radius:14px;border-top-right-radius:4px;background:rgba(255,255,255,.05)}
.mx-reply.is-mine .mx-reply-body{background:rgba(126,230,187,.1)}
.mx-reply-top{display:flex;align-items:center;gap:8px}
.mx-reply-top .mx-name-btn{font-size:13px}
.mx-reply-top time{font-size:10.5px;color:var(--mx-muted)}
.mx-reply-del{display:grid;place-items:center;width:26px;height:26px;margin-inline-start:auto;border:0;background:none;color:var(--mx-muted);cursor:pointer}
.mx-reply-del svg{width:14px;height:14px}
.mx-reply-body p{font-size:13.5px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.mx-reply-hint{font-size:12.5px;color:var(--mx-muted);text-align:center;padding:6px 0}
.mx-reply-form{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end}
.mx-reply-form textarea{min-height:42px;max-height:110px;resize:none;padding:10px 12px;border:1px solid var(--mx-line);border-radius:14px;background:#0c1c22;color:var(--mx-text);font:inherit;font-size:14px;line-height:1.5}
.mx-reply-form textarea:focus{outline:2px solid var(--mx-gold);outline-offset:1px;border-color:transparent}
.mx-reply-send{display:grid;place-items:center;width:44px;height:42px;border:0;border-radius:13px;background:var(--mx-cta);color:#20163f;cursor:pointer}
.mx-reply-send svg{transform:scaleX(-1);width:18px;height:18px}

/* الملف العام */
#mx-profile-host .mx-sheet{justify-items:stretch}
.mx-profile-top{display:flex;align-items:center;gap:14px}
.mx-profile-name{display:grid;gap:6px;justify-items:start}
.mx-profile-name b{font-size:20px;font-weight:800;color:var(--mx-gold-soft)}
.mx-profile-stats{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--mx-line);border-radius:16px;background:rgba(8,16,20,.28);overflow:hidden}
.mx-profile-stats>div{display:grid;gap:2px;justify-items:center;padding:10px 4px;text-align:center}
.mx-profile-stats>div+div{border-inline-start:1px solid var(--mx-line)}
.mx-profile-stats small{font-size:10.5px;color:var(--mx-muted)}
.mx-profile-stats b{font-size:18px;font-weight:800;color:var(--mx-gold-soft);font-variant-numeric:tabular-nums}
.mx-profile-stats span{font-size:10px;color:var(--mx-muted)}
.mx-profile-note,.mx-profile-hint{font-size:12.5px;line-height:1.7;color:var(--mx-muted);text-align:center}
.mx-profile-self{text-align:center;font-size:13.5px;color:var(--mx-mint);font-weight:700}


.mx-flag{display:inline-grid;place-items:center;width:32px;height:32px;margin-inline-start:auto;padding:0;border:0;border-radius:10px;background:transparent;color:var(--mx-muted,#9fb5ad);cursor:pointer}
.mx-flag.is-small{width:26px;height:26px;margin-inline-start:6px}.mx-flag:hover{color:#ff9d92}
.mx-safe-row{display:flex;justify-content:center;margin:10px 0 0}
.mx-safe-btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border:1px solid rgba(255,143,134,.45);border-radius:12px;background:rgba(255,143,134,.07);color:#ff9d92;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.mx-report-layer{position:fixed;inset:0;z-index:2147482500;display:grid;align-items:end}
.mx-report-bg{position:absolute;inset:0;background:rgba(3,10,13,.72)}
.mx-report-card{position:relative;display:grid;gap:10px;width:min(520px,100%);margin:0 auto;padding:18px 16px calc(92px + env(safe-area-inset-bottom,0px));border:1px solid rgba(154,210,191,.2);border-bottom:0;border-radius:22px 22px 0 0;background:#12303a;color:#f4f1e8}
.mx-report-card h3{margin:0;font-size:18px;color:#f6e9c0}.mx-rp-sub{margin:0;font-size:12.5px;line-height:1.7;color:#9fb5ad}
.mx-rp-reasons{display:grid;gap:6px}.mx-rp-reasons label{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid rgba(154,210,191,.2);border-radius:12px;font-size:14px;cursor:pointer}
.mx-rp-reasons input{accent-color:#e6cf94;width:18px;height:18px}
.mx-report-card textarea{width:100%;padding:10px;border-radius:12px;border:1px solid rgba(154,210,191,.2);background:#0c161b;color:inherit;font:inherit;resize:none}
.mx-rp-msg{min-height:0;margin:0;font-size:12.5px;color:#ff9d92}.mx-rp-msg:empty{display:none}
.mx-rp-actions{display:flex;gap:8px}.mx-rp-actions button{flex:1;min-height:46px;border:1px solid rgba(154,210,191,.25);border-radius:13px;background:rgba(255,255,255,.05);color:inherit;font:inherit;font-weight:700;cursor:pointer}
.mx-rp-actions .mx-rp-main{border:0;background:linear-gradient(135deg,#c2b0f7,#9a85e6);color:#1b1630}
