/* شكل مسابقة الاختلافات المباشرة */
.site-bar-inner { padding-block: 8px; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.live { max-width: 1120px; margin-inline: auto; padding: 4px 14px 24px; }
.blocked-screen {
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 20px; background: #000; color: #fff; text-align: center;
}
.blocked-screen[hidden] { display: none; }
.blocked-screen p { margin: 0; font-size: 22px; font-weight: 700; }
.blocked-screen small { color: #9aa5ab; font-size: 14px; }
.panel { max-width: 560px; margin-inline: auto; padding-block: 10px; text-align: center; }
.panel h1 { font-size: clamp(26px, 6vw, 40px); font-weight: 700; }
.panel p { margin: 8px 0 0; color: #d6e2e8; white-space: pre-line; }
.big { font-size: clamp(72px, 24vw, 140px); font-weight: 700; line-height: 1; color: #fff; }
.who { color: var(--gold); font-weight: 600; }
.form { display: grid; gap: 10px; width: min(100%, 320px); margin: 18px auto 0; }
.form input {
  width: 100%; padding: 12px; border: 0; border-radius: 12px; text-align: center;
  background: var(--felt-2); color: var(--ink); font-family: var(--body); font-size: 17px;
}
.form input::placeholder { color: #b9c8d0; }
.entry { display: grid; gap: 10px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.mode-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1 / 1.28; padding: 8px 6px; border: 0; border-radius: 20px; background: #fff; color: #0f1320; box-shadow: 0 1px 2px rgba(15, 19, 32, .05), 0 14px 30px -22px rgba(15, 19, 32, .35); font: inherit; text-decoration: none; cursor: pointer; transition: transform .15s; }
.mode-tile i { font-size: 30px; font-style: normal; line-height: 1.2; }
.mode-tile b { font-size: 16px; font-weight: 800; line-height: 1.3; }
.mode-tile small { color: #6c7384; font-size: 11.5px; line-height: 1.35; }
@media (hover: hover) {
  .mode-tile:hover { background: linear-gradient(135deg, #2746f2, #1a2fb5); color: #fff; transform: translateY(-3px); }
  .mode-tile:hover small { color: #c9d2ff; }
}
/* الجوال ما فيه مرور: الأزرق يطلع وقت الضغط */
.mode-tile:active, .mode-tile:focus-visible { background: linear-gradient(135deg, #2746f2, #1a2fb5); color: #fff; }
.mode-tile:active small, .mode-tile:focus-visible small { color: #c9d2ff; }
.top-box { display: grid; gap: 14px; margin-top: 8px; text-align: start; }
.top-visually { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.top-part { min-width: 0; }
.top-part h3 { margin: 0 0 8px; font-size: 17px; font-weight: 800; }
.panel .top-empty { margin: 0; padding: 14px; border-radius: 16px; background: #fff; color: #6c7384; font-size: 14px; text-align: center; }
.top-part ol { margin: 0; padding: 0; list-style: none; }
.top-part ol:empty { display: none; }
.top-part .rank-row:first-child { border-top: 0; }
.room-scores { margin-top: 18px; text-align: start; }
.solo-target { aspect-ratio: 1 / 1; }
.solo-target b { font-size: 30px; }
.solo-title { margin: 12px 0 8px; color: #0f1320; font-size: 22px; font-weight: 800; }
.solo-rules { display: grid; gap: 7px; margin: 0 0 16px; padding: 14px 16px; border-radius: 18px; background: #fff; box-shadow: 0 1px 2px rgba(15, 19, 32, .05), 0 14px 30px -22px rgba(15, 19, 32, .35); color: #0f1320; font-size: 14px; line-height: 1.6; list-style: none; text-align: start; }
.solo-rules li { position: relative; padding-inline-start: 16px; }
.solo-rules li::before { content: ''; position: absolute; inset-inline-start: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: #2746f2; }
#soloBack { width: 100%; margin-top: 12px; }
#soloActions { flex-wrap: nowrap; gap: 6px; margin-top: 8px; }
#soloActions .btn { flex: 1; min-width: 0; min-height: 46px; padding: 6px 4px; font-size: 13.5px; line-height: 1.3; }
.solo-info { margin: 0 0 6px; color: #0f1320; font-size: 15px; font-weight: 700; text-align: center; }
.mode-tile:focus-visible { outline: 2px solid #2746f2; outline-offset: 2px; }
.room-box { margin-top: 12px; }
.room-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
@media (max-width: 620px) { .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.room-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1 / 1; padding: 8px; border: 1px solid rgba(233, 180, 76, .55); border-radius: 16px; background: linear-gradient(160deg, #164a63, #0b2a3c); color: #f7f4ec; font: inherit; cursor: pointer; }
.room-tile b { font-size: 18px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.room-tile small { color: #c7d8df; font-size: 13px; }
.room-tile .room-status { color: #f6cf7b; }
.room-tile.playing .room-status { color: #4ade80; }
.room-empty { grid-column: 1 / -1; margin: 6px 0; color: var(--muted); font-size: 14px; }
.room-dialog { width: min(340px, calc(100vw - 32px)); padding: 20px; border: 1px solid rgba(233, 180, 76, .55); border-radius: 16px; background: #0b2a3c; color: #f7f4ec; text-align: center; }
.room-dialog::backdrop { background: rgba(2, 12, 20, .72); backdrop-filter: blur(4px); }
.room-dialog h2 { margin: 0 0 12px; font-size: 22px; font-weight: 700; }
.room-dialog form { display: grid; gap: 10px; }
.room-dialog input { box-sizing: border-box; width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; background: rgba(255, 255, 255, .08); color: #f7f4ec; font: inherit; font-size: 20px; text-align: center; }
.room-dialog input::placeholder { color: #b9c8d0; font-size: 16px; }
.room-dialog-note { margin: 0; color: #ff9a9a; font-size: 13px; }
.room-dialog-note:empty { display: none; }
.room-dialog .room-ask { display: block; margin: 14px auto 12px; }
.room-dialog #roomDialogClose { width: 100%; }
.room-ask { padding: 0; border: 0; background: none; color: var(--gold); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.chat-off .chat-open { display: none; }
.entry .form { margin-top: 14px; }
.entry-label { font-size: 18px; font-weight: 700; color: var(--gold); }
.panel .entry-note { margin: 0; color: var(--muted); font-size: 14px; }
.row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
[hidden] { display: none !important; }

/* العدادات فوق الصور */
.counters { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; margin-bottom: 8px; text-align: center; }
.counters b { display: block; font-size: clamp(25px, 6vw, 36px); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.counters small { color: var(--muted); font-size: 12px; }
#foundCount { color: #6cf07d; }
.timer.low b { color: #ff6b5e; }

/* الصورتين: جنب بعض في الكمبيوتر، وفوق بعض في الجوال */
.pics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pic {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px;
  background: var(--felt); box-shadow: 0 18px 42px rgba(0, 0, 0, .45);
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.solo-round #picA { cursor: default; }
.pic img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.reveal-pic { width: min(100%, 420px); margin: 14px auto 0; cursor: default; }
.pics.locked .pic { filter: saturate(.55) brightness(.75); }
@media (max-aspect-ratio: 1 / 1) {
  .pics {
    grid-template-columns: 1fr; margin-inline: auto;
    /* نصغّر الصور إذا الشاشة قصيرة عشان الاثنين يبانون مع بعض */
    width: min(100%, calc((100vh - 165px) / 2 * 4 / 3));
    width: min(100%, calc((100dvh - 165px) / 2 * 4 / 3));
    min-width: 240px;
  }
}
/* 🔦📡 المساعدات */
.help-bar { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 8px; flex-wrap: wrap; }
.help-btn {
  font: inherit; font-size: 14px; font-weight: 700; color: #f4ecff; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(190, 120, 255, .55);
  background: rgba(40, 14, 70, .75); box-shadow: 0 0 10px rgba(170, 90, 255, .35);
}
.help-btn.on { background: #7b2cff; border-color: #d9b8ff; box-shadow: 0 0 16px rgba(190, 120, 255, .8); }
.help-btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.help-left { font-size: 13px; color: #36e6ff; text-shadow: 0 0 8px rgba(54, 230, 255, .6); }
@media (max-aspect-ratio: 1 / 1) {
  .has-help .pics {
    width: min(100%, calc((100vh - 210px) / 2 * 4 / 3));
    width: min(100%, calc((100dvh - 210px) / 2 * 4 / 3));
  }
}
.hint-quarter {
  position: absolute; width: 50%; height: 50%; pointer-events: none; border-radius: 8px;
  border: 3px dashed #ffe45c; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45), inset 0 0 24px rgba(255, 228, 92, .45);
  animation: hintGlow 1.2s ease-in-out infinite alternate;
}
@keyframes hintGlow { to { border-color: #fff6b8; } }
.radar-ring {
  --radar: hsl(120, 90%, 50%); position: absolute; width: 12%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%);
  border: 3px solid var(--radar); box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 0 14px var(--radar);
}
/* 📡 وقت الرادار: سحب الإصبع على الصورة ما يحرك الصفحة */
.pics.radar-on .pic { touch-action: none; }
.radar-ring.beat { animation: radarBeat .25s ease-out; }
@keyframes radarBeat { from { transform: translate(-50%, -50%) scale(1.35); } }
.pics.radar-on .pic { outline: 2px solid rgba(54, 230, 255, .5); }
@media (prefers-reduced-motion: reduce) { .hint-quarter, .radar-ring.beat { animation: none; } }
.ring, .miss { position: absolute; transform: translate(-50%, -50%); pointer-events: none; aspect-ratio: 1; border-radius: 50%; }
.ring { border: 3px solid #39e27d; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5), 0 0 16px rgba(57, 226, 125, .6); animation: pop .3s ease-out; }
.ring.reveal { border-color: #ff6b5e; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5), 0 0 16px rgba(255, 107, 94, .6); }
.miss { width: 11%; display: flex; align-items: center; justify-content: center; color: #ff5a4d; font-size: clamp(24px, 5vw, 40px); font-weight: 700; text-shadow: 0 0 3px #000, 0 0 3px #000; animation: fade .9s forwards; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } }
@keyframes fade { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ring, .miss { animation: none; } }
.note { min-height: 24px; margin: 8px 0 0; text-align: center; font-weight: 500; }

/* قوائم الترتيب */
.board { list-style: none; width: min(100%, 460px); margin: 16px auto 0; padding: 0; text-align: start; }
.board h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.board li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.board li.me { padding-inline: 8px; border-radius: 6px; border-bottom-color: transparent; background: #2dd4bf; color: #04231d; font-weight: 700; }
.board li.off { opacity: .5; }
.board span { min-width: 0; overflow-wrap: anywhere; }
.board b { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }

/* لوحة تحكم صاحب الغرفة */
.link-box { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.link-box input { flex: 1; min-width: 180px; padding: 10px; border: 0; border-radius: 10px; background: var(--felt-2); color: var(--ink); font-size: 12px; direction: ltr; text-align: left; }
.whatsapp { background: #25d366 !important; color: #06301a !important; box-shadow: none !important; }
.danger { background: #b3362e !important; color: #fff !important; }
.controls { display: grid; gap: 10px; margin-top: 18px; }
.controls .btn { width: 100%; padding: 14px; font-size: 18px; }
.status-line { margin-top: 14px; font-size: 17px; font-weight: 600; }
.status-line small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
/* غرفة تحدي الأصدقاء */
.mode-tile.wide { grid-column: 1 / -1; flex-direction: row; gap: 12px; aspect-ratio: auto; padding: 14px 16px; text-align: start; }
.mode-tile.wide span { display: grid; gap: 2px; }
.friends-lobby { display: grid; gap: 10px; margin-top: 12px; text-align: start; }
.friends-code { text-align: center; font-size: 16px; }
.friends-code b { font-size: 26px; letter-spacing: 3px; font-variant-numeric: tabular-nums; }
.friends-share { display: grid; gap: 8px; }
.friends-share .btn { width: 100%; text-align: center; }
.friends-online { display: grid; gap: 6px; padding: 10px; border-radius: 16px; background: #fff; color: #0f1320; }
.friends-online button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: #eef1ff; color: #0f1320; font: inherit; font-weight: 700; cursor: pointer; text-align: start; }
.friends-online button span:last-child { margin-inline-start: auto; color: #2746f2; font-size: 13px; }
.friends-online button[disabled] { opacity: .6; cursor: default; }
.friends-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.friends-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #fff; color: #0f1320; font-weight: 700; }
.friends-list li.off { opacity: .5; }
.friends-list small { margin-inline-start: auto; color: #6c7384; font-weight: 400; }
.friends-wait { text-align: center; }
/* سكورات اللاعبين: مكانها ثابت على اليمين، وكل واحد بترتيب دخوله */
.friends-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.friends-bar li { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 8px; border-radius: 14px; background: #fff; color: #0f1320; font-size: 13px; font-weight: 700; box-shadow: 0 1px 2px rgba(15, 19, 32, .08); }
.friends-bar .who { display: grid; min-width: 0; line-height: 1.25; }
.friends-bar .who bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friends-bar .who small { font-size: 12px; font-weight: 400; opacity: .85; }
.friends-bar .who, .friends-bar .who * { color: #0f1320 !important; }
.friends-bar li.me .who, .friends-bar li.me .who *, .friends-bar li.done .who, .friends-bar li.done .who * { color: #fff !important; }
@media (min-width: 720px) {
  #round.friends-round { display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 14px; align-items: start; }
  #round.friends-round > * { grid-column: 2; }
  #round.friends-round > #friendsBar { grid-column: 1; grid-row: 1 / span 8; position: sticky; top: 10px; grid-template-columns: 1fr; }
}
.friends-bar li.me { background: #2746f2; color: #fff; }
.friends-bar li.done { background: #17a34a; color: #fff; }
.friends-bar li.off { opacity: .45; }
.friends-bar .rank-avatar, .friends-list .rank-avatar, .friends-online .rank-avatar { width: 26px; height: 26px; font-size: 13px; }
/* مستطيل كود الغرفة تحت مربعات اللعب */
.code-strip { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 20px; background: #fff; color: #0f1320; box-shadow: 0 1px 2px rgba(15, 19, 32, .05), 0 14px 30px -22px rgba(15, 19, 32, .35); }
.code-strip label { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 800; white-space: nowrap; }
.code-strip label i { font-style: normal; }
.code-strip input { min-width: 0; height: 42px; padding: 0 10px; border: 1px solid #dfe2e8; border-radius: 12px; background: #f7f8fa; color: #0f1320; font: inherit; font-size: 16px; letter-spacing: 2px; text-align: center; }
.code-strip input::placeholder { letter-spacing: 0; font-size: 12.5px; }
.code-strip .btn { margin: 0; min-height: 42px; padding: 0 14px; }
.code-strip.bad input { border-color: #d92d20; }
@media (max-width: 380px) { .code-strip { grid-template-columns: minmax(0, 1fr) auto; } .code-strip label { grid-column: 1 / -1; } }
/* «ابدأ» رمادي لين الكل يضغط «جاهز»، وبعدها يصير أزرق */
#friendsStart:disabled, #friendsNext:disabled { background: #c9ced8 !important; color: #fff !important; box-shadow: none !important; opacity: 1; cursor: default; }
.friends-ready.on { background: #17a34a !important; color: #fff !important; }
.friends-list small.ok { color: #17a34a; font-weight: 700; }
.friends-list small.wait { color: #b26b00; }

/* نتيجة الجولة في تحدي الأصدقاء */
.friends-bar .result-tag { margin-inline-start: auto; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.friends-bar .result-tag.win { background: #fff4d6; color: #8a5a00; }
.friends-bar .result-tag.lose { background: #fde8e6; color: #d92d20; }

/* «تحدّى المتصلين» أول زر، وجنبه العدد بالأخضر */
.friends-pick .online-count { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 6px; padding: 2px 10px; border-radius: 99px; background: #dcfce7; color: #15803d; font-size: 13px; font-weight: 800; }
.friends-pick .online-count:empty { display: none; }
.friends-bar li.lost .rank-avatar { filter: grayscale(1); opacity: .65; }

/* 🔊🎤 بالغرف: عمود للصوت برا الصورتين تماماً (عشان العدالة)، والعرض يكبر بقدّه فالصور ما تصغر (علي 26/11) */
.ldfVoice { display: none; }
.pics:has(> .ldfVoice.side-on) { grid-template-columns: 1fr 1fr 48px; }
.pics > .ldfVoice.side-on { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; grid-column: 3; grid-row: 1; }
@media (max-aspect-ratio: 1 / 1) {
  .pics:has(> .ldfVoice.side-on) { grid-template-columns: 48px minmax(0, 1fr); width: min(100%, calc((100dvh - 165px) / 2 * 4 / 3 + 58px)); }
  .has-help .pics:has(> .ldfVoice.side-on) { width: min(100%, calc((100dvh - 210px) / 2 * 4 / 3 + 58px)); }
  .pics:has(> .ldfVoice.side-on) > #picA { grid-column: 2; grid-row: 1; }
  .pics:has(> .ldfVoice.side-on) > #picB { grid-column: 2; grid-row: 2; }
  .pics > .ldfVoice.side-on { grid-column: 1; grid-row: 1 / span 2; } /* يمين الصور (بعيد عن زر 👁️ اللي يسار) */
}

/* 👤 علي 27/11: داخل اللعبة فوق بس سهم الرجوع، بدون بروفايل اللاعب وزر «ادمن» */
html body .site-bar .profile-btn, html body .site-bar .t7-admin-btn, html body .site-bar .dash-btn, html body .t7-admin-btn, html body .profile-btn { display: none !important; }
/* 🎯 علي 27/11: اللعب الفردي ما فيه أحد تكلمه، فالمايك والسماعة ما يطلعون */
#round.solo-round .ldfVoice > :not(.ldfEye) { display: none !important; }
/* 👁️ علي 27/11: زر المشاهدة جنب المايك والسماعة بدل ما يغطي الصور */
.ldfVoice > .ldfEye { position: static; transform: none; display: flex; justify-content: center; }
.ldfVoice > .ldfEye[hidden] { display: none; }
.ldfVoice > .ldfEye .sp-btn { position: relative; width: 40px; height: 40px; min-height: 0; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 18px; }
.ldfVoice > .ldfEye .sp-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #120826; background: #3ee08a; }
.ldfVoice > .ldfEye .sp-dot.off { background: #ff5a78; }
.ldfVoice > .ldfEye .sp-n { position: absolute; left: -4px; top: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ffd84d; color: #1a0b2e; font-size: 11px; font-weight: 900; line-height: 16px; text-align: center; }
.ldfVoice > .ldfEye .sp-btn { background: rgba(18, 8, 38, .78); box-shadow: 0 0 10px rgba(150, 60, 255, .45); border: 1px solid rgba(168, 85, 247, .5); color: #fff; cursor: pointer; }
.ldfVoice > .ldfEye .sp-cnt { position: absolute; left: -4px; top: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ffd84d; color: #1a0b2e; font-size: 11px; font-weight: 900; line-height: 16px; text-align: center; }
