/* XD_GAME_TOPBAR_V1 — نفس شريط الهاتف المكسور في كل الألعاب.
   القيم منسوخة من public/games/telephone/style.css حرفيًا، ومحصورة في
   .xd-topbar عشان ما تصطدم بأنماط كل لعبة. */
header.xd-topbar{
 height:72px!important;min-height:0;padding:10px 18px!important;
 display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;
 border-bottom:1px solid rgba(255,255,255,.08)!important;
 background:rgba(15,15,15,.9)!important;backdrop-filter:blur(14px);
 position:sticky!important;top:0!important;z-index:40!important;pointer-events:auto!important;left:auto!important;right:auto!important;
 margin:0!important;border-radius:0!important;box-shadow:none!important;width:auto!important;box-sizing:border-box!important;
}
header.xd-topbar>*{pointer-events:auto!important}
header.xd-topbar .xd-topbar-brand{display:flex!important;align-items:center!important;gap:9px!important;color:#aaa!important;text-decoration:none!important;min-width:0;flex:0 1 auto}
header.xd-topbar .xd-topbar-brand img{width:38px!important;height:38px!important;object-fit:contain!important;border-radius:0!important;flex:0 0 auto}
header.xd-topbar .xd-topbar-brand>span{display:flex!important;align-items:center!important;gap:4px!important;line-height:1.25!important;min-width:0;white-space:nowrap!important}
header.xd-topbar .xd-topbar-brand strong{font:900 .72rem Cairo,sans-serif!important;color:#fff!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
header.xd-topbar .xd-topbar-brand small{font:800 .62rem Cairo,sans-serif!important;color:#8c8c94!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

header.xd-topbar .xd-topbar-actions{display:flex!important;align-items:center!important;gap:8px!important;flex:0 0 auto;margin:0!important;padding:0!important;border:0!important;background:none!important}

header.xd-topbar .account-pill,
header.xd-topbar .xd-game-account-trigger{display:flex!important;align-items:center!important;gap:7px!important;padding:6px 9px!important;border:1px solid rgba(255,255,255,.08)!important;border-radius:13px!important;background:#141414!important;margin:0!important;cursor:pointer}
header.xd-topbar .account-pill img,
header.xd-topbar .xd-game-account-trigger img{width:30px!important;height:30px!important;border-radius:9px!important;object-fit:cover!important}
header.xd-topbar .account-pill>span:not(.xd-game-trigger-avatar):not(.xd-game-coin-pill):not(.xd-game-login-label){display:grid!important;line-height:1.25!important;min-width:0}
header.xd-topbar .account-pill b{font:800 .56rem Cairo,sans-serif!important;color:#f5f5f5!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:11ch}
header.xd-topbar .account-pill small{font:700 .43rem Cairo,sans-serif!important;color:#777!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

header.xd-topbar .xd-topbar-actions button:not(.xd-game-account-trigger),
header.xd-topbar .xd-topbar-actions a:not(.account-pill):not(.xd-game-account-trigger){
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 background:transparent!important;color:#fff!important;border:1px solid rgba(255,255,255,.72)!important;
 padding:9px 12px!important;border-radius:11px!important;min-height:0!important;
 font:800 .58rem Cairo,sans-serif!important;text-decoration:none!important;cursor:pointer;
 white-space:nowrap;transition:.18s;
}
header.xd-topbar .xd-topbar-actions button:not(.xd-game-account-trigger):hover,
header.xd-topbar .xd-topbar-actions a:not(.account-pill):not(.xd-game-account-trigger):hover{background:rgba(255,255,255,.08)!important;border-color:#fff!important;color:#fff!important}

/* كل عناصر الشريط بنفس الارتفاع مهما كانت أنماط اللعبة الأصلية */
header.xd-topbar .xd-topbar-actions>*{height:40px!important;min-height:40px!important;box-sizing:border-box!important;margin:0!important}
header.xd-topbar .xd-topbar-actions button:not(.xd-game-account-trigger),
header.xd-topbar .xd-topbar-actions a:not(.account-pill):not(.xd-game-account-trigger){
 padding:0 12px!important;line-height:1!important;backdrop-filter:none!important;
}
header.xd-topbar .account-pill,
header.xd-topbar .xd-game-account-trigger{padding:0 8px!important}

/* نفس نقاط الكسر حق الهاتف المكسور، بس نبقي الحساب موجود كصورة بدل ما يختفي */
@media(max-width:820px){
 header.xd-topbar{height:auto!important;min-height:64px!important;padding:8px!important}
 header.xd-topbar .account-pill>span:not(.xd-game-trigger-avatar){display:none!important}
 header.xd-topbar .account-pill,
 header.xd-topbar .xd-game-account-trigger{padding:4px!important;border-radius:11px!important}
}
@media(max-width:580px){
 /* الأزرار تبقى ظاهرة في الجوال — تصغر ولا تختفي */
 header.xd-topbar{padding:8px 10px!important;gap:8px!important}
 header.xd-topbar .xd-topbar-brand img{width:30px!important;height:30px!important}
 header.xd-topbar .xd-topbar-brand strong{font-size:.62rem!important}
 header.xd-topbar .xd-topbar-brand small{font-size:.52rem!important}
 /* الأزرار لا تنضغط — الاسم هو اللي يتقلّص، وإلا انقص عرض الزر عن نصه */
 header.xd-topbar .xd-topbar-actions{gap:6px!important;flex:0 0 auto!important;min-width:0}
 header.xd-topbar .xd-topbar-actions>*{flex:0 0 auto!important;white-space:nowrap!important}
 header.xd-topbar .xd-topbar-brand{flex:1 1 auto!important;min-width:0!important;overflow:hidden!important}
 header.xd-topbar .xd-topbar-actions button:not(.xd-game-account-trigger),
 header.xd-topbar .xd-topbar-actions a:not(.account-pill):not(.xd-game-account-trigger){
  display:inline-flex!important;padding:7px 9px!important;font-size:.5rem!important;border-radius:9px!important
 }
}
/* الشريط كان عائمًا والصفحة حاجزة له فراغ علوي — بعد ما صار في السياق
   نلغي الفراغ حتى لا يتكرر الارتفاع مرتين (كان يبيّن كعطل في الجوال). */
body.xd-topbar-was-floating .game-page,
body.xd-topbar-was-floating .meme-page,
body.xd-topbar-was-floating .page,
body.xd-topbar-was-floating main.page{padding-top:24px!important}
@media(max-width:820px){
 body.xd-topbar-was-floating .game-page,
 body.xd-topbar-was-floating .meme-page,
 body.xd-topbar-was-floating .page,
 body.xd-topbar-was-floating main.page{padding-top:16px!important}
}
/* /XD_GAME_TOPBAR_V1 */

/* XD_MOBILE_GAMES_BACK_V60 */
@media(max-width:580px){
 header.xd-topbar .xd-topbar-actions a[href="/community-games"],
 header.xd-topbar .xd-topbar-actions a[href="/community-games/"]{
  width:auto!important;min-width:0!important;height:36px!important;min-height:36px!important;
  padding:0 10px!important;gap:0!important;border-radius:10px!important;
  border:1px solid rgba(255,255,255,.22)!important;
  background:transparent!important;box-shadow:none!important;
  color:#f2f2f2!important;font:900 .54rem/1 Cairo,sans-serif!important;
  white-space:nowrap!important;
 }
 header.xd-topbar .xd-topbar-actions a[href="/community-games"]:before,
 header.xd-topbar .xd-topbar-actions a[href="/community-games/"]:before,
 header.xd-topbar .xd-topbar-actions a[href="/community-games"]:after,
 header.xd-topbar .xd-topbar-actions a[href="/community-games/"]:after{content:none!important;display:none!important}
 header.xd-topbar .xd-topbar-actions a[href="/community-games"]:active,
 header.xd-topbar .xd-topbar-actions a[href="/community-games/"]:active{transform:scale(.97)!important}
}
/* /XD_MOBILE_GAMES_BACK_V60 */


/* XD_TOPBAR_ADMIN_SWAP_V61 */
header.xd-topbar .xd-topbar-swap-hidden{display:none!important}
html:not(.xd-room-param) .xd-server-owner-badge{display:none!important}
html.xd-room-param .xd-server-owner-badge{display:grid!important}
/* /XD_TOPBAR_ADMIN_SWAP_V61 */


/* XD_TOPBAR_ADMIN_SWAP_V63 */
html.xd-room-param:not(.xd-owner-gameplay) #xdOwnerAdminButton{display:none!important}
html.xd-room-param:not(.xd-owner-gameplay) #xdGameRulesUnifiedBtn,
html.xd-room-param:not(.xd-owner-gameplay) #rulesBtn,
html.xd-room-param:not(.xd-owner-gameplay) #xdGameRulesBtn,
html.xd-room-param:not(.xd-owner-gameplay) .xd-game-rules-trigger{display:inline-flex!important}
html.xd-owner-gameplay.xd-owner-host #xdOwnerAdminButton{display:inline-flex!important}
html.xd-owner-gameplay.xd-owner-host #xdGameRulesUnifiedBtn,
html.xd-owner-gameplay.xd-owner-host #rulesBtn,
html.xd-owner-gameplay.xd-owner-host #xdGameRulesBtn,
html.xd-owner-gameplay.xd-owner-host .xd-game-rules-trigger{display:none!important}
/* /XD_TOPBAR_ADMIN_SWAP_V63 */


/* XD_UNIFIED_ROOM_CONTROL_V265 — نفس زر التحكم في كل الألعاب: إعدادات في اللوبي، أدمن أثناء اللعب. */
header.xd-topbar #xdServerSettingsUnified{
 order:-3!important;
 display:inline-flex!important;
 align-items:center!important;
 justify-content:center!important;
 height:40px!important;
 min-height:40px!important;
 padding:0 13px!important;
 border-radius:11px!important;
 white-space:nowrap!important;
 font:900 .58rem/1 Cairo,sans-serif!important;
}
header.xd-topbar #xdServerSettingsUnified[hidden]{display:none!important}
header.xd-topbar #xdServerSettingsUnified.xd-unified-settings-mode{
 border:1px solid rgba(255,255,255,.72)!important;
 background:transparent!important;
 color:#fff!important;
 box-shadow:none!important;
}
header.xd-topbar #xdServerSettingsUnified.xd-unified-admin-mode{
 border:1px solid rgba(245,158,11,.55)!important;
 background:linear-gradient(180deg,rgba(245,158,11,.18),rgba(245,158,11,.07))!important;
 color:#fbbf24!important;
 box-shadow:0 6px 18px rgba(245,158,11,.07)!important;
}
header.xd-topbar #xdServerSettingsUnified.xd-unified-admin-mode:hover{
 border-color:#f59e0b!important;
 background:rgba(245,158,11,.22)!important;
 color:#fde68a!important;
}
html:has(#xdServerSettingsUnified) #xdOwnerAdminButton{
 visibility:hidden!important;opacity:0!important;pointer-events:none!important;
 width:0!important;min-width:0!important;max-width:0!important;height:0!important;min-height:0!important;
 padding:0!important;margin:0!important;border:0!important;overflow:hidden!important;flex:0 0 0!important
}
@media(max-width:580px){
 header.xd-topbar #xdServerSettingsUnified{
  height:36px!important;min-height:36px!important;padding:0 9px!important;
  border-radius:9px!important;font-size:.5rem!important
 }
}
/* /XD_UNIFIED_ROOM_CONTROL_V265 */
