/* ══════════════════════════════════════
   RANDOM MATCH ROOM
   ══════════════════════════════════════ */

#random-match-room {
  position: fixed; inset: 0; z-index: 200;
  background: #0f0f1a;
  flex-direction: column;
  font-family: 'Tajawal', sans-serif;
}

/* ── Header ── */
#rm-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f43f5e22, #a855f722);
  border-bottom: 1px solid rgba(244,63,94,.15);
  flex-shrink: 0;
}
#rm-back-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.08); cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
#rm-header-title { font-size: 16px; font-weight: 800; color: #fff; }
#rm-header-sub   { font-size: 12px; color: rgba(255,255,255,.45); margin-top: 1px; }

/* ── قسم البحث ── */
#rm-search-section {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  padding: 32px 24px;
}
#rm-search-title {
  font-size: 20px; font-weight: 900; color: #fff; text-align: center;
}
#rm-search-desc {
  font-size: 14px; color: rgba(255,255,255,.5); text-align: center; line-height: 1.6;
}

/* ── Radar animation ── */
#rm-search-illustration { position: relative; width: 160px; height: 160px; }
.rm-radar { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.rm-radar-ring {
  position: absolute; border-radius: 50%;
  border: 2px solid rgba(244,63,94,.4);
  animation: rmPulse 2.4s ease-out infinite;
}
.rm-ring1 { width: 60px;  height: 60px;  animation-delay: 0s; }
.rm-ring2 { width: 100px; height: 100px; animation-delay: .6s; }
.rm-ring3 { width: 140px; height: 140px; animation-delay: 1.2s; }
@keyframes rmPulse {
  0%   { transform: scale(.7); opacity: .8; }
  100% { transform: scale(1);  opacity: 0; }
}
.rm-radar-icon {
  font-size: 36px; z-index: 1; position: relative;
  animation: rmFloat 3s ease-in-out infinite;
}
@keyframes rmFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ── زر البحث ── */
#rm-search-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 36px; border-radius: 50px; border: none;
  background: linear-gradient(135deg, #f43f5e, #a855f7);
  color: #fff; font-size: 16px; font-weight: 800;
  cursor: pointer; box-shadow: 0 4px 20px rgba(244,63,94,.4);
  transition: transform .15s, box-shadow .15s;
  font-family: 'Tajawal', sans-serif;
}
#rm-search-btn:active { transform: scale(.95); box-shadow: 0 2px 10px rgba(244,63,94,.3); }

/* ── حالة البحث ── */
#rm-searching-state {
  display: none; flex-direction: column; align-items: center; gap: 14px;
}
.rm-pulse-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: #f43f5e;
  animation: rmDotPulse 1s ease-in-out infinite;
}
@keyframes rmDotPulse {
  0%,100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.5); opacity: .5; }
}
#rm-searching-text { color: rgba(255,255,255,.7); font-size: 15px; }
#rm-cancel-btn {
  padding: 8px 24px; border-radius: 50px; border: 1px solid rgba(255,255,255,.2);
  background: transparent; color: rgba(255,255,255,.6); font-size: 14px;
  cursor: pointer; font-family: 'Tajawal', sans-serif;
}

/* ── قسم الشات ── */
#rm-chat-section {
  flex: 1; display: none; flex-direction: column; overflow: hidden;
}

/* ── شريط الشريك ── */
#rm-partner-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
#rm-partner-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg,#f43f5e,#a855f7);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px; font-weight: 800; color: #fff;
}
#rm-partner-avatar img { width: 100%; height: 100%; object-fit: cover; }
#rm-partner-name   { font-size: 15px; font-weight: 700; color: #fff; }
#rm-partner-status { font-size: 12px; color: rgba(255,255,255,.45); margin-top: 1px; }
#rm-partner-info   { flex: 1; }
#rm-new-match-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 50px; border: 1px solid rgba(244,63,94,.4);
  background: rgba(244,63,94,.1); color: #f43f5e;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: 'Tajawal', sans-serif; transition: background .15s;
}
#rm-new-match-btn:active { background: rgba(244,63,94,.2); }

/* ── الرسائل ── */
#rm-msgs {
  flex: 1; overflow-y: auto; padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.rm-msg { display: flex; }
.rm-msg-out { justify-content: flex-end; }
.rm-msg-in  { justify-content: flex-start; }
.rm-bub {
  max-width: 72%; padding: 10px 14px; font-size: 15px;
  line-height: 1.5; word-break: break-word; border-radius: 18px;
}
.rm-msg-out .rm-bub {
  background: linear-gradient(135deg, #f43f5e, #a855f7);
  color: #fff; border-radius: 18px 18px 4px 18px;
}
.rm-msg-in .rm-bub {
  background: rgba(255,255,255,.1); color: #fff;
  border-radius: 18px 18px 18px 4px;
}
.rm-sys {
  text-align: center; font-size: 12px;
  color: rgba(255,255,255,.35); padding: 6px 0;
}

/* ── شريط الكتابة ── */
#rm-chat-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.04);
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
#rm-input {
  flex: 1; background: rgba(255,255,255,.08); border: none; border-radius: 22px;
  padding: 10px 16px; color: #fff; font-size: 15px; outline: none;
  font-family: 'Tajawal', sans-serif;
}
#rm-input::placeholder { color: rgba(255,255,255,.35); }
#rm-input:disabled { opacity: .4; }
#rm-send-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #f43f5e, #a855f7);
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: transform .15s;
}
#rm-send-btn:active   { transform: scale(.9); }
#rm-send-btn:disabled { opacity: .4; }
