:root {
  --bg: radial-gradient(circle at top, #10163a, #060914);
  --card: #151a2e;
  --primary: #5b8cff;
  --accent: #ff9800;
  --danger: #ff4d4d;
  --success: #4caf50;
  --text: #ffffff;
  --soft: #b8c1ff;
    --card-bg-safe: rgba(110, 160, 255, 0.45);
  --card-bg-outcast: #ffe6e6;
  --text-safe: #fff;
  --text-outcast: #900;
  --button-bg: #888;
  --button-text: #fff;
  --glow-red: rgba(255, 0, 0, 0.2);
  --glow-green: rgba(0, 255, 0, 0.2);
}
.glow-red {
  box-shadow: 0 0 15px var(--glow-red);
}

.glow-green {
  box-shadow: 0 0 15px var(--glow-green);
}


body {
  margin: 0;
  padding: 16px;
  font-family: Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  transition: all 0.3s ease;
   overflow-x: hidden;
}
body {
  transition: background 0.3s ease, color 0.3s ease;
}

button, .card, .modal-content {
  transition: background 0.3s ease, box-shadow 0.3s ease;
}


h1,h2,h3 {
  color: var(--soft);
  margin: 14px 0;
  text-shadow: 0 0 8px rgba(91,140,255,0.4);
  white-space: normal; /* العنوان على أسطر */
}

input {
  background: #ffffff;
  color: #000;
  font-size: 15px;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid var(--primary);
  text-align: center;
  width: 100%;
  max-width: 420px;
  margin: 10px auto;
  box-sizing: border-box;
}

input[type="number"] {
  background: #0f1533;
  color: #fff;
  border: 2px dashed var(--primary);
}

button {
  
  max-width: 420px;
  font-size: 18px;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #5b8cff, #7c4dff);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  margin: 10px auto;
  transition: 0.25s;
}

/* ==========================
   theme-night– glow Game
========================== */
body.theme-night {
  --bg:
radial-gradient(
  circle at top,
  rgba(0,255,255,0.15) 0%,
  rgba(0,120,120,0.55) 65%
),
radial-gradient(
  circle at bottom,
  rgba(255,0,255,0.12) 0%,
  rgba(120,0,120,0.55) 65%
),
linear-gradient(
  180deg,
  #05050a 0%,
  #0a0a16 50%,
  #05050a 100%
);


  --card: linear-gradient(145deg, #0c0f1f, #080a16);
  --primary: #00f7ff;
  --accent: #ff2dff;
  --success: #39ff14;
  --danger: #ff1744;
  --text: #eafcff;
  --soft: #9ffcff;

  background: var(--bg);
  color: var(--text);
        background-attachment: fixed; /* مهم جدًا */
  background-repeat: no-repeat;
}

/* توهج عام */
body.theme-night * {
  text-shadow: 0 0 6px rgba(0,255,255,0.35);
}

/* العناوين */
body.theme-night h1,
body.theme-night h2,
body.theme-night h3 {
  color: var(--primary);
  text-shadow:
    0 0 10px rgba(0,255,255,0.8),
    0 0 20px rgba(0,255,255,0.6);
}

/* البطاقات */
body.theme-night .info-box,
body.theme-night .modal-content,
body.theme-night .rules-modal {
	
  background: var(--card);
  border: 1px solid rgba(0,255,255,0.4);
  box-shadow:
    0 0 20px rgba(0,255,255,0.3),
    inset 0 0 15px rgba(0,255,255,0.15);
}
body.theme-night .counter-box {
  background: var(--card);
  border: 1px solid rgba(0,255,255,0.35);
  color: var(--text);
  box-shadow:
    0 0 15px rgba(0,255,255,0.8),
    0 0 30px rgba(255,45,255,0.6);
}
body.theme-night .word-controls {

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--card);
  border: 1px solid rgba(0,255,255,0.35);
  color: var(--soft);
  animation: neonFlicker 2.4s infinite;
  
  box-sizing: border-box;
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  width: 100%;
  max-width: 420px;
  margin: 12px auto;
  box-shadow:     0 0 15px rgba(0,255,255,0.8),
    0 0 30px rgba(255,45,255,0.6);
  font-size: 16px;
  line-height: 1.6;
}
/* الأزرار */
body.theme-night button,
body.theme-night .rules-btn,
body.theme-night .theme-toggle {
  background: linear-gradient(135deg, #00f7ff, #ff2dff);
  color: #000;
  box-shadow:
    0 0 15px rgba(0,255,255,0.8),
    0 0 30px rgba(255,45,255,0.6);
}

body.theme-night button:hover {
  transform: scale(1.05);
  box-shadow:
    0 0 25px rgba(0,255,255,1),
    0 0 45px rgba(255,45,255,0.8);
}

/* قائمة اللاعبين */
body.theme-night li {
  background: linear-gradient(145deg, #0b1022, #060815);
  border: 1px solid rgba(0,255,255,0.35);
  box-shadow: 0 0 14px rgba(0,255,255,0.25);
}

/* اختيار لاعب */
body.theme-night li.selected {
  border: 2px solid var(--accent);
  background: linear-gradient(145deg, #1a0033, #0d001a);
  box-shadow:
    0 0 25px rgba(255,45,255,0.9),
    0 0 45px rgba(0,255,255,0.7);
}

/* إدخالات */
body.theme-night input {
  background: #02040a;
  color: var(--text);
  border: 2px solid var(--primary);
  box-shadow: 0 0 12px rgba(0,255,255,0.5);
}

/* مودال الفوز */
body.theme-night .modal-content.glow-green {
  box-shadow:
    0 0 30px rgba(57,255,20,0.9),
    0 0 60px rgba(57,255,20,0.6);
}

/* مودال الخسارة */
body.theme-night .modal-content.glow-red {
  box-shadow:
    0 0 30px rgba(255,23,68,0.9),
    0 0 60px rgba(255,23,68,0.6);
}


/* ===== AVATAR PICKER FINAL – CLEAN ===== */

body.theme-night .avatar-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 45px;
}

/* صورة الأفاتار */
body.theme-night .avatar-picker img {
  width: 80px;
  height: 80px;
  border-radius: 50%;      /* ⭕ دائري 100% */
  object-fit: cover;       /* قص صحيح */
  display: block;
}

/* أزرار الأسهم – بدون خلفية */
body.theme-night .avatar-arrow {
  background: none !important;  /* ❌ بدون خلفية */
  border: none;
  color: var(--primary);
  font-size: 66px;
  cursor: pointer;
  padding: 0;
  line-height: 0;
}
/* تأثير لطيف عند المرور */
body.theme-night .avatar-arrow:hover {
  color: var(--accent);
  transform: scale(1.2);
}

/*-----------------------------------------------*/
/* ===== PLAYERS GRID ===== */

body.theme-night .players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
  padding: 0;
  margin: 20px auto;
  max-width: 520px;
}

/* كرت اللاعب */
body.theme-night .players-grid li {
  list-style: none;
  background: linear-gradient(145deg, #151a2e, #1b2150);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  text-align: center;
  font-size: 14px;
}

/* صورة الأفاتار */
body.theme-night .players-grid li img {
  width: 45px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* اسم اللاعب */
body.theme-night .players-grid li span {
  font-size: 14px;
  font-weight: bold;
  color: var(--soft);
}

/* زر الطرد */
body.theme-night .players-grid .button-kick {
  margin-top: 6px;
  width: auto;
  font-size: 13px;
  padding: 6px 10px;
}
body.theme-night .modal {
  position: fixed;
  inset: 0;                 /* top:0 right:0 bottom:0 left:0 */
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;  /* توسيط أفقي */
  align-items: center;      /* توسيط عمودي */
  z-index: 2000;
}

/* محتوى المودال */
body.theme-night .modal-content {
  background: linear-gradient(145deg, #151a2e, #1b2150);
  padding: 24px;
  border-radius: 18px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  animation: popIn 0.3s ease;
}
  body.theme-night  .neon-box {
      border: 2px solid #00f7ff;
      border-radius: 12px;
      padding: 14px;
      margin-bottom: 16px;
      box-shadow:
        0 0 5px #00f7ff,
        0 0 15px rgba(0, 247, 255, 0.6);
    }
	

   body.theme-night .neon-box label {
      display: block;
      margin-bottom: 8px;
      font-size: 14px;
      color: #8be9fd;
    }

   body.theme-night .neon-box select {
      width: 100%;
      padding: 12px;
      font-size: 16px;
      border-radius: 8px;
      border: none;
      outline: none;
      background: #111827;
      color: #ffffff;
    }

  body.theme-night  .neon-box select:focus {
      box-shadow:
        0 0 5px #00f7ff,
        0 0 12px #00f7ff;
    }
/* ==========================
   Normal Theme – Elite Game
========================== */
body.theme-normal {
  --bg:
radial-gradient(
  circle at top,
  rgba(80,120,255,0.25) 0%,
  rgba(30,45,120,0.6) 65%
),
radial-gradient(
  circle at bottom,
  rgba(0,0,0,0.15) 0%,
  rgba(30,45,120,0.6) 65%
),
linear-gradient(
  180deg,
  #0f1222 0%,
  #14182e 50%,
  #0f1222 100%
);

  --card: linear-gradient(145deg, #181c3a, #11142c);
  --primary: #5b8cff;
  --accent: #ff9800;
  --success: #4caf50;
  --danger: #ff4d4d;
  --text: #e9ecff;
  --soft: #b8c1ff;

  background: var(--bg);
  color: var(--text);
      background-attachment: fixed; /* مهم جدًا */
  background-repeat: no-repeat;
}

/* طبقة عمق */
body.theme-normal::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(91,140,255,0.12), transparent 70%);
  pointer-events: none;
}

/* العناوين */
body.theme-normal h1,
body.theme-normal h2,
body.theme-normal h3 {
  color: var(--primary);
  text-shadow:
    0 0 12px rgba(91,140,255,0.8),
    0 0 24px rgba(40,80,180,0.6);
}

/* جميع البوكسات */
body.theme-normal .info-box,
body.theme-normal .modal-content,
body.theme-normal .rules-modal,
body.theme-normal .counter-box {
  background: var(--card);
  border: 1px solid rgba(91,140,255,0.45);
  box-shadow:
    0 8px 28px rgba(0,0,0,0.6),
    inset 0 0 20px rgba(91,140,255,0.15);
  color: var(--soft);
}
body.theme-normal .word-controls {

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--card);
  border: 1px solid rgba(91,140,255,0.45);
  color: var(--soft);
  animation: neonFlicker 2.4s infinite;
  
  box-sizing: border-box;
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  width: 100%;
  max-width: 420px;
  margin: 12px auto;
  box-shadow: 0 4px 15px rgba(91,140,255,0.3);
  font-size: 16px;
  line-height: 1.6;
}
/* الأزرار – إحساس زر لعبة حقيقي */
body.theme-normal button,
body.theme-normal .rules-btn,
body.theme-normal .theme-toggle,
body.theme-normal #openGuessWindow {
  background: linear-gradient(145deg, #5b8cff, #3f6fe0);
  color: #fff;
  border: 1px solid rgba(91,140,255,0.6);
  box-shadow:
    0 6px 22px rgba(91,140,255,0.55),
    inset 0 0 10px rgba(255,255,255,0.15);
  letter-spacing: 0.5px;
}

body.theme-normal button:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 35px rgba(91,140,255,0.9);
}

/* الإدخالات */
body.theme-normal input {
  background: #0d1025;
  color: var(--text);
  border: 2px solid var(--primary);
  box-shadow: inset 0 0 12px rgba(91,140,255,0.35);
}

/* قائمة اللاعبين */
body.theme-normal li {
  background: linear-gradient(145deg, #14183a, #0f132e);
  border: 1px solid rgba(91,140,255,0.35);
  box-shadow: 0 6px 18px rgba(0,0,0,0.55);
  color: var(--soft);
}

/* اللاعب المحدد */


/* ===== AVATAR PICKER FINAL – CLEAN ===== */

body.theme-normal .avatar-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 45px;
}

/* صورة الأفاتار */
body.theme-normal .avatar-picker img {
  width: 80px;
  height: 80px;
  border-radius: 50%;      /* ⭕ دائري 100% */
  object-fit: cover;       /* قص صحيح */
  display: block;
}

/* أزرار الأسهم – بدون خلفية */
body.theme-normal .avatar-arrow {
  background: none !important;  /* ❌ بدون خلفية */
  border: none;
  color: var(--primary);
  font-size: 66px;
  cursor: pointer;
  padding: 0;
  line-height: 0;
}
/* تأثير لطيف عند المرور */
body.theme-normal .avatar-arrow:hover {
  color: var(--accent);
  transform: scale(1.2);
}

/*-----------------------------------------------*/
/* ===== PLAYERS GRID ===== */

body.theme-normal .players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
  padding: 0;
  margin: 20px auto;
  max-width: 520px;
}

/* كرت اللاعب */
body.theme-normal .players-grid li {
  list-style: none;
  background: linear-gradient(145deg, #151a2e, #1b2150);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  text-align: center;
  font-size: 14px;
}

/* صورة الأفاتار */
body.theme-normal .players-grid li img {
  width: 45px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* اسم اللاعب */
body.theme-normal .players-grid li span {
  font-size: 14px;
  font-weight: bold;
  color: var(--soft);
}

/* زر الطرد */
body.theme-normal .players-grid .button-kick {
  margin-top: 6px;
  width: auto;
  font-size: 13px;
  padding: 6px 10px;
}
body.theme-normal .modal {
  position: fixed;
  inset: 0;                 /* top:0 right:0 bottom:0 left:0 */
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;  /* توسيط أفقي */
  align-items: center;      /* توسيط عمودي */
  z-index: 2000;
}

/* محتوى المودال */
body.theme-normal .modal-content {
  background: linear-gradient(145deg, #151a2e, #1b2150);
  padding: 24px;
  border-radius: 18px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  animation: popIn 0.3s ease;
}


/* ==========================
   Anomaly Mode – Power Light
========================== */
body.theme-day {
  --bg:
   radial-gradient(
  circle at top,
  rgba(120,160,255,0.25) 0%,
  rgba(20,30,80,0.65) 60%
),
radial-gradient(
  circle at bottom,
  rgba(0,0,0,0.35) 0%,
  rgba(20,30,80,0.65) 60%
),
linear-gradient(
  180deg,
  #0b1026 0%,
  #12173a 50%,
  #151a3a 100%
);


  --card: linear-gradient(145deg, #141a44, #0d1233);
  --primary: #6ea0ff;
  --accent: #ff9800;
  --success: #2ecc71;
  --danger: #ff3b3b;

  /* أهم تعديل */
  --text: #ffffff;
  --soft: #e0e6ff;

  background: var(--bg);
  color: var(--text);
    background-attachment: fixed; /* مهم جدًا */
  background-repeat: no-repeat;
}

/* تشويش / غرابة خفيفة */
body.theme-day::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(110,160,255,0.18), transparent 70%),
    repeating-linear-gradient(
      -45deg,
      rgba(255,255,255,0.03) 0px,
      rgba(255,255,255,0.03) 2px,
      transparent 4px,
      transparent 8px
    );
  pointer-events: none;
}

/* العناوين – عدائية */
body.theme-day h1,
body.theme-day h2,
body.theme-day h3 {
  color: #ffffff;
  text-shadow:
    0 0 12px rgba(110,160,255,0.9),
    0 0 28px rgba(60,100,255,0.8);
}

/* كل البوكسات */
body.theme-day .info-box,
body.theme-day .modal-content,
body.theme-day .rules-modal,
body.theme-day .counter-box {
  background: var(--card);
  border: 1px solid rgba(110,160,255,0.6);
  color: var(--text);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.75),
    inset 0 0 25px rgba(110,160,255,0.2);
}
body.theme-day .word-controls {

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--card);
  border: 1px solid rgba(110,160,255,0.6);
  color: var(--soft);
  animation: neonFlicker 2.4s infinite;
  
  box-sizing: border-box;
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  width: 100%;
  max-width: 420px;
  margin: 12px auto;
  box-shadow: 0 4px 15px rgba(91,140,255,0.3);
  font-size: 16px;
  line-height: 1.6;
}
/* الأزرار – زر لعبة عنيف */
body.theme-day button,
body.theme-day .rules-btn,
body.theme-day .theme-toggle,
body.theme-day #openGuessWindow {
  background: linear-gradient(145deg, #6ea0ff, #3f6cff);
  color: #ffffff;
  border: 2px solid rgba(150,200,255,0.9);
  box-shadow:
    0 0 25px rgba(110,160,255,0.9),
    inset 0 0 14px rgba(255,255,255,0.25);
  letter-spacing: 0.6px;
}

body.theme-day button:hover {
  transform: scale(1.07);
  box-shadow:
    0 0 45px rgba(110,160,255,1);
}

/* الإدخالات */
body.theme-day input {
  background: #070b22;
  color: #ffffff;
  border: 2px solid var(--primary);
  box-shadow:
    inset 0 0 14px rgba(110,160,255,0.45);
}

/* قائمة اللاعبين */
body.theme-day li {
  background: linear-gradient(145deg, #0c1133, #070b22);
  border: 2px solid rgba(110,160,255,0.45);
  color: #ffffff;
  box-shadow:
    0 6px 20px rgba(0,0,0,0.85);
}

/* اللاعب المختار – خطر */
body.theme-day li.selected {
  border: 3px solid var(--accent);
  background: linear-gradient(145deg, #2a1f00, #140e00);
  color: #ffffff;
  box-shadow:
    0 0 25px rgba(255,152,0,1),
    0 0 55px rgba(255,152,0,0.85);
  transform: scale(1.06);
}

/* شريط القوانين */
body.theme-day .rules-bar {
  background: linear-gradient(135deg, #0d1233, #1b2a6b);
  box-shadow:
    0 0 25px rgba(110,160,255,0.8);
}

/* مودالات النتيجة */
body.theme-day .modal-content.glow-green {
  box-shadow:
    0 0 35px rgba(46,204,113,0.9),
    0 0 70px rgba(46,204,113,0.6);
}

body.theme-day .modal-content.glow-red {
  box-shadow:
    0 0 35px rgba(255,59,59,0.9),
    0 0 70px rgba(255,59,59,0.6);
}

/* ===== AVATAR PICKER FINAL – CLEAN ===== */

body.theme-day .avatar-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 45px;
}

/* صورة الأفاتار */
body.theme-day .avatar-picker img {
  width: 80px;
  height: 80px;
  border-radius: 50%;      /* ⭕ دائري 100% */
  object-fit: cover;       /* قص صحيح */
  display: block;
}

/* أزرار الأسهم – بدون خلفية */
body.theme-day .avatar-arrow {
  background: none !important;  /* ❌ بدون خلفية */
  border: none;
  color: var(--primary);
  font-size: 66px;
  cursor: pointer;
  padding: 0;
  line-height: 0;
}
/* تأثير لطيف عند المرور */
body.theme-day .avatar-arrow:hover {
  color: var(--accent);
  transform: scale(1.2);
}

/*-----------------------------------------------*/
/* ===== PLAYERS GRID ===== */

body.theme-day .players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
  padding: 0;
  margin: 20px auto;
  max-width: 520px;
}

/* كرت اللاعب */
body.theme-day .players-grid li {
  list-style: none;
  background: linear-gradient(145deg, #151a2e, #1b2150);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  text-align: center;
  font-size: 17px;
}

/* صورة الأفاتار */
body.theme-day .players-grid li img {
  width: 45px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* اسم اللاعب */
body.theme-day .players-grid li span {
  font-size: 16px;
  font-weight: bold;
  color: var(--soft);
}

/* زر الطرد */
body.theme-day .players-grid .button-kick {
  margin-top: 6px;
  width: auto;
  font-size: 13px;
  padding: 6px 10px;
}
body.theme-day .modal {
  position: fixed;
  inset: 0;                 /* top:0 right:0 bottom:0 left:0 */
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;  /* توسيط أفقي */
  align-items: center;      /* توسيط عمودي */
  z-index: 2000;
}

/* محتوى المودال */
body.theme-day .modal-content {
  background: linear-gradient(145deg, #151a2e, #1b2150);
  padding: 24px;
  border-radius: 18px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  animation: popIn 0.3s ease;
}
body.theme-day .neon-box {
  border: 2px solid rgba(110,160,255,0.8);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  background: linear-gradient(145deg, #121a44, #0c1233);
  box-shadow:
    0 8px 20px rgba(0,0,0,0.5),
    inset 0 0 18px rgba(110,160,255,0.25);
}

body.theme-day .neon-box label {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
  color: #e6ecff;
  text-shadow: 0 0 6px rgba(110,160,255,0.6);
}
body.theme-day .neon-box select {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border-radius: 10px;
  border: none;
  outline: none;
  background: linear-gradient(145deg, #0d143d, #090f2e);
  color: #5b8cff;
  box-shadow:
    inset 0 0 10px rgba(110,160,255,0.35),
    0 4px 12px rgba(0,0,0,0.6);
}

/* عند التركيز */
body.theme-day .neon-box select:focus {
  box-shadow:
    0 0 10px rgba(110,160,255,0.9),
    0 0 22px rgba(110,160,255,0.6);
}

body.theme-day .neon-checkbox {
  width: 70%;
  display: flex;
  justify-content: center;
  margin: 16px auto;
}

body.theme-day .neon-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 15px;
  color: #ffffff;
}

/* الخلفية */
body.theme-day .neon-toggle .slider {
  background-color: #1b2a6b;
  box-shadow:
    inset 0 0 10px rgba(110,160,255,0.4);
}

/* الدائرة */
body.theme-day .neon-toggle .slider::before {
  background-color: #ffffff;
  box-shadow: 0 0 6px rgba(110,160,255,0.8);
}

/* عند التفعيل */
body.theme-day .neon-toggle input:checked + .slider {
  background-color: #ff9800;
  box-shadow:
    0 0 12px rgba(255,152,0,0.9);
}

body.theme-day .neon-toggle input:checked + .slider::before {
  transform: translateX(22px);
  background-color: #121212;
}
body.theme-day * {
  text-shadow: 0 0 4px rgba(110,160,255,0.25);
}


/* ==========================
   ثيم النيون (Neon Pulse)
========================== */

/* ==========================
   Impostor Theme – Red Glow
========================== */
/* ==========================
   Impostor Theme – BLOOD MODE
========================== */
body.theme-impostor {
--bg:
    radial-gradient(
      circle at top,
      rgba(255, 80, 30, 0.28) 0%,
      rgba(80, 0, 0, 0.6) 65%
    ),
    radial-gradient(
      circle at bottom,
      rgba(0, 0, 0, 0.35) 0%,
      rgba(80, 0, 0, 0.6) 65%
    ),
    linear-gradient(
      180deg,
      #2b0000 0%,
      #7a0000 50%,
      #a00000 100%
    );


  --card: linear-gradient(145deg, #4a0000, #160000);

  --primary: #ff2b2b;     /* دم ناري */
  --accent: #ff0000;      /* أحمر قاتل */
  --danger: #ff1a1a;
  --success: #4caf50;
  --text: #ffd6d6;
  --soft: #ff9b9b;

  background: var(--bg);
  color: var(--text);
  background-attachment: fixed; /* مهم جدًا */
  background-repeat: no-repeat;
}

/* 🩸 توهج دموي عام + اهتزاز خفيف */
body.theme-impostor * {
  text-shadow: 0 0 8px rgba(255,0,0,0.6);
}

/* ======================
   العناوين (مرعبة)
====================== */
body.theme-impostor h1,
body.theme-impostor h2,
body.theme-impostor h3 {
  color: var(--primary);
  text-shadow:
    0 0 10px rgba(255,0,0,0.9),
    0 0 25px rgba(180,0,0,0.9),
    0 0 45px rgba(120,0,0,0.8);
}
body.theme-impostor  .players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
  padding: 0;
  margin: 20px auto;
  max-width: 520px;
}

/* كرت اللاعب */
body.theme-impostor  .players-grid li {
  list-style: none;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  text-align: center;
  font-size: 14px;
}

/* صورة الأفاتار */
body.theme-impostor  .players-grid li img {
  width: 45px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* اسم اللاعب */
body.theme-impostor  .players-grid li span {
  font-size: 14px;
  font-weight: bold;
  color: var(--soft);
}
/* ======================
   البطاقات (دم مشع)
====================== */
body.theme-impostor .info-box,
body.theme-impostor .modal-content,
body.theme-impostor .rules-modal,
body.theme-impostor .counter-box {
  background: var(--card);
  border: 1px solid rgba(255,0,0,0.7);
  box-shadow:
    0 0 25px rgba(255,0,0,0.35),
    inset 0 0 30px rgba(255,0,0,0.25);
  color: var(--soft);
  animation: bloodPulse 2.4s infinite;
}
body.theme-impostor .word-controls {

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--card);
  border: 1px solid rgba(255,0,0,0.7);
  color: var(--soft);
  animation: bloodPulse 2.4s infinite;
  
  box-sizing: border-box;
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  width: 100%;
  max-width: 420px;
  margin: 12px auto;
  box-shadow: 0 4px 15px rgba(91,140,255,0.3);
  font-size: 16px;
  line-height: 1.6;
}
/* ======================
   الأزرار (خطر!)
====================== */
body.theme-impostor button,
body.theme-impostor .rules-btn,
body.theme-impostor .theme-toggle,
body.theme-impostor #openGuessWindow {
  background: linear-gradient(145deg, #ff2b2b, #8b0000);
  color: #fff;
  border: 1px solid rgba(255,0,0,0.7);
  box-shadow:
    0 0 25px rgba(255,0,0,0.8),
    inset 0 0 12px rgba(255,255,255,0.1);
}

body.theme-impostor button:hover {
  transform: scale(1.08);
  box-shadow:
    0 0 45px rgba(255,0,0,1),
    0 0 80px rgba(180,0,0,0.9);
}

/* ======================
   الإدخالات (مُشِعة)
====================== */
body.theme-impostor input {
  background: radial-gradient(circle, #2a0000, #120000);
  color: var(--text);
  border: 2px solid var(--primary);
  box-shadow:
    0 0 20px rgba(255,0,0,0.6),
    inset 0 0 20px rgba(255,0,0,0.35);
}

/* ======================
   اللاعبين
====================== */
body.theme-impostor li {
  background: linear-gradient(145deg, #420000, #1a0000);
  border: 1px solid rgba(255,0,0,0.6);
  box-shadow:
    0 0 18px rgba(255,0,0,0.35);
  color: var(--soft);
}

/* اللاعب المختار – المنبوذ الحقيقي */
body.theme-impostor li.selected {
  border: 3px solid var(--accent);
  background: linear-gradient(145deg, #6a0000, #2a0000);
  box-shadow:
    0 0 35px rgba(255,0,0,1),
    0 0 70px rgba(255,40,40,0.9);
  transform: scale(1.08);
  animation: bloodRage 1.4s infinite;
}

/* ======================
   المودالات (نهاية دموية)
====================== */
body.theme-impostor .modal-content.glow-red {
  box-shadow:
    0 0 45px rgba(255,0,0,1),
    0 0 90px rgba(180,0,0,0.9);
}

body.theme-impostor .modal-content.glow-green {
  box-shadow:
    0 0 30px rgba(76,175,80,0.8),
    0 0 60px rgba(76,175,80,0.6);
}
body.theme-impostor .rules-bar {
  background: linear-gradient(287deg, rgba(255, 0, 0, 0.35), #ff4d4d);
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
 /* border-radius: 14px; */
  padding: 6px 0;
}

body.theme-impostor .rules-text {
  display: inline-block;
  padding-left: 100%; /* يبدأ من خارج الشاشة على اليسار */
  animation: scrollRules 80s linear infinite; /* وقت الحركة */
 
}

@keyframes scrollRules {

  100% {
    transform: translateX(100%);
  }
}


/* ======================
   ANIMATIONS
====================== */
@keyframes bloodPulse {
  0%,100% {
    box-shadow:
      0 0 18px rgba(255,0,0,0.35),
      inset 0 0 25px rgba(255,0,0,0.25);
  }
  50% {
    box-shadow:
      0 0 35px rgba(255,0,0,0.7),
      inset 0 0 40px rgba(255,0,0,0.45);
  }
}

@keyframes bloodRage {
  0%   { box-shadow: 0 0 25px rgba(255,0,0,0.7); }
  50%  { box-shadow: 0 0 60px rgba(255,0,0,1); }
  100% { box-shadow: 0 0 25px rgba(255,0,0,0.7); }
}
@keyframes neonFlicker {
  0%, 100% {
    box-shadow:
      0 0 10px #00faff,
      0 0 20px #00faff,
      inset 0 0 15px rgba(0,250,255,.5);
    opacity: 1;
  }
  48% { opacity: .9; }
  50% {
    box-shadow:
      0 0 20px #00faff,
      0 0 60px #00faff,
      inset 0 0 30px rgba(0,250,255,.8);
    opacity: .85;
  }
}
.win-animation {
  font-size: 80px;
  text-align: center;
  color: gold;
  animation: winEffect 4s ease forwards;
  
}

@keyframes winEffect {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  40% {
    transform: scale(1.4);
    opacity: 1;
  }
  70% {
    transform: scale(1);
  }
  100% {
    opacity: 0;
  }
}
/* اهتزاز سريع للخاسر */
@keyframes shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-2px, 1px) rotate(-1deg); }
  20% { transform: translate(2px, -1px) rotate(1deg); }
  30% { transform: translate(-2px, 1px) rotate(-1deg); }
  40% { transform: translate(2px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(1px, -2px) rotate(1deg); }
  70% { transform: translate(-1px, 1px) rotate(0deg); }
  80% { transform: translate(1px, -1px) rotate(1deg); }
  90% { transform: translate(-1px, 1px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.lose-animation {
  display: inline-block;
  font-size: 2em;
  animation: shake 0.5s ease-in-out 0s 8; /* 8 مرات لمدة نصف ثانية لكل مرة */
  color: #ff4444; /* أحمر للخسارة */
  font-weight: bold;
}
/* اهتزاز وانكسار الشاشة */
@keyframes breakScreen {
  0%   { transform: translate(0, 0) rotate(0deg); background-color: #0000; }
  10%  { transform: translate(-10px, 5px) rotate(-2deg); background-color: rgba(0,0,0,0.1); }
  20%  { transform: translate(8px, -8px) rotate(2deg); background-color: rgba(0,0,0,0.15); }
  30%  { transform: translate(-6px, 6px) rotate(-1.5deg); background-color: rgba(0,0,0,0.2); }
  40%  { transform: translate(6px, -6px) rotate(1.5deg); background-color: rgba(0,0,0,0.25); }
  50%  { transform: translate(-4px, 4px) rotate(-1deg); background-color: rgba(0,0,0,0.3); }
  60%  { transform: translate(4px, -4px) rotate(1deg); background-color: rgba(0,0,0,0.35); }
  70%  { transform: translate(-2px, 2px) rotate(-0.5deg); background-color: rgba(0,0,0,0.4); }
  80%  { transform: translate(2px, -2px) rotate(0.5deg); background-color: rgba(0,0,0,0.45); }
  90%  { transform: translate(-1px, 1px) rotate(-0.2deg); background-color: rgba(0,0,0,0.5); }
  100% { transform: translate(0, 0) rotate(0deg); background-color: rgba(0,0,0,0.6); }
}

.shake-screen {
  animation: breakScreen 0.5s ease-in-out 0s 8; /* 8 مرات */
  pointer-events: auto; /* السماح للنقرات بالمرور إذا هناك أزرار */
}


@keyframes loseEffect {
  0% {
    transform: scale(1);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  60% {
    transform: translateX(-10px);
  }
  80% {
    transform: translateX(10px);
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}
#confettiCanvas,
#loserCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}
#restartBtn {
  position: relative;
  z-index: 10000; /* أعلى من canvas و shake */
  pointer-events: auto; /* تأكد أن الزر يقبل النقر */
}
#restartBtn,
#closeBtn {
  position: relative;
  z-index: 10000;
}
#resultAnimation.shake-screen {
  animation: breakScreen 0.5s ease-in-out 0s 8;
  pointer-events: auto; /* يظل قابل للنقر داخليًا إذا احتوى على عناصر */
}
.vote-mark {
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* الحاوية */
body.theme-night .neon-checkbox {
  width: 67%;
  display: flex;
  justify-content: center; /* يضع العنصر بالوسط */
  font-family: Arial, sans-serif;
  font-size: 16px;
  color: #fff;
  padding: 10px;
  background-color: #111;
  border-radius: 10px;
  box-shadow: 0 0 10px #0ff, 0 0 20px #0ff inset;
}

/* الحاوية للزر + النص */
.neon-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

/* اخفاء الـ checkbox الأصلي */
.neon-toggle-label input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* شكل الزر */
.neon-toggle-label .slider {
  position: relative;
  width: 50px;
  height: 28px;
  background-color: #444;
  border-radius: 34px;
  box-shadow: 0 0 5px #0ff;
  transition: 0.4s;
}

/* الدائرة داخل الزر */
.neon-toggle-label .slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #0ff;
  border-radius: 50%;
  box-shadow: 0 0 5px #0ff, 0 0 10px #0ff;
  transition: 0.4s;
}

/* الحالة المفعلّة */
.neon-toggle-label input:checked + .slider {
  background-color: #0ff;
  box-shadow: 0 0 10px #0ff, 0 0 20px #0ff inset;
}

.neon-toggle-label input:checked + .slider::before {
  transform: translateX(22px);
  background-color: #111;
  box-shadow: 0 0 5px #0ff, 0 0 10px #0ff;
}

/* نص التسمية */
.neon-toggle-label .label-text {
  font-size: 15px;
  color: #8be9fd;
}


.theme-toggle {
  position: fixed;
  top: 40px;
  left: 15px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #5b8cff, #7c4dff);
  color: white;
  font-size: 22px;
  cursor: pointer;
  display: flex;             /* لتوسيط الايقونة */
  justify-content: center;   /* أفقيًا */
  align-items: center;       /* عموديًا */
  box-shadow: 0 0 15px rgba(91,140,255,0.6);
  z-index: 9999;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.app-container {
  max-width: 520px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}


button:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 15px rgba(91,140,255,0.4);
}

button:active {
  transform: scale(0.96);
}

/* شريط المعلومات فوق العنوان */
.rules-bar {
  background: linear-gradient(135deg, #5b8cff, #7c4dff);
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
 /* border-radius: 14px; */
  padding: 6px 0;
}

.rules-text {
  display: inline-block;
  padding-left: 100%; /* يبدأ من خارج الشاشة على اليسار */
  animation: scrollRules 80s linear infinite; /* وقت الحركة */
 
}

@keyframes scrollRules {

  100% {
    transform: translateX(100%);
  }
}



/* زر التعليمات دائري */
.rules-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 22px;
  background: linear-gradient(135deg, #5b8cff, #7c4dff);
  box-shadow: 0 0 20px rgba(91,140,255,0.6);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center; /* لتوسيط ❓ داخل الدائرة */
  z-index: 1000;
}

/* صندوق التعليمات */
.rules-modal {
  display: none;
  position: fixed;
  top: 10%;
  right: 5%;
  width: 90%;
  max-width: 400px;
  background: var(--card);
  padding: 20px;
  border-radius: 16px;
  z-index: 1001;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  transition: right 0.4s ease;
}

.rules-modal.show {
  display: block;
}

.rules-modal h4 {
  color: var(--accent);
  text-align: center;
}

.rules-modal p {
  line-height: 1.8;
  font-size: 15px;
}

/* QR Code في منتصف غرفة الانتظار */
#qrCodeContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 20px auto;
}

.qr-box {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* قائمة اللاعبين */
ul {
  list-style: none;
  padding: 0;
  margin: 10px auto;
  width: 100%;
  max-width: 420px;
}

li {
  background: linear-gradient(145deg, #1b2150, #13183b);
  margin-bottom: 10px;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.25s;
}

/* عنصر اللاعب */


/* Glow برتقالي نابض عند التحديد */
li.selected {
  border: 2px solid #ff9800;
  box-shadow:
    0 0 10px rgba(255, 152, 0, 0.7),
    0 0 20px rgba(255, 152, 0, 0.5);
  animation: pulseOrange 1.4s infinite;
  transform: scale(1.04);
  background: linear-gradient(145deg, #2a1f00, #1b1500);
}

/* أنيميشن النبض */
@keyframes pulseOrange {
  0% {
    box-shadow:
      0 0 8px rgba(255, 152, 0, 0.6),
      0 0 14px rgba(255, 152, 0, 0.4);
  }
  50% {
    box-shadow:
      0 0 14px rgba(255, 152, 0, 0.9),
      0 0 26px rgba(255, 152, 0, 0.7);
  }
  100% {
    box-shadow:
      0 0 8px rgba(255, 152, 0, 0.6),
      0 0 14px rgba(255, 152, 0, 0.4);
  }
}

/* زر طرد أصغر */
.button-kick {
  width: 100%;
  max-width: 100px;
  font-size: 16px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff4d4d, #ff1a1a);
  color: #fff;
}

/* صندوق المعلومات */
.info-box {
box-sizing: border-box;
  background: linear-gradient(145deg, #151a2e, #1b2150);
  padding: 16px;
  border-radius: 16px;
  color: var(--soft);
  text-align: center;
  width: 100%;
  max-width: 420px;
  margin: 12px auto;
  box-shadow: 0 4px 15px rgba(91,140,255,0.3);
  font-size: 16px;
  line-height: 1.6;
}

/* كل سطر معلومات */
.info-line {
  margin: 6px 0;
  font-weight: 500;
}

/* حالة المنبوذ */
.info-line.impostor {
  color: var(--danger);
  font-weight: bold;
}

/* كلمة السر أو غيره */
.info-line.secret {
  color: var(--accent);
  font-weight: bold;
}

/* عداد المنبوذين */
.info-line span.counter {
  font-weight: bold;
  color: var(--primary);
}
/* المودال (الخلفية) */
.modal {
  position: fixed;
  inset: 0;                 /* top:0 right:0 bottom:0 left:0 */
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;  /* توسيط أفقي */
  align-items: center;      /* توسيط عمودي */
  z-index: 2000;
}

/* محتوى المودال */
.modal-content {
  background: linear-gradient(145deg, #151a2e, #1b2150);
  padding: 24px;
  border-radius: 18px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  animation: popIn 0.3s ease;
}

/* حركة دخول لطيفة */
@keyframes popIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
/* Glow أحمر للمنبوذ */
.modal-content.glow-red {
  box-shadow:
    0 0 25px rgba(255, 77, 77, 0.8),
    0 0 50px rgba(255, 77, 77, 0.6);
}

/* Glow أخضر للبريء */
.modal-content.glow-green {
  box-shadow:
    0 0 25px rgba(76, 175, 80, 0.8),
    0 0 50px rgba(76, 175, 80, 0.6);
}
#endScreen {
  animation: endFade 0.6s ease;
}

@keyframes endFade {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
/* الطبقة الخلفية التي تمنع التفاعل مع باقي الصفحة */
#secretWordWindow {
  position: fixed;       /* تثبيت على الشاشة بالكامل */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7); /* خلفية شفافة داكنة */
  display: flex;
  align-items: center;   /* عموديًا بالوسط */
  justify-content: center; /* أفقيًا بالوسط */
  z-index: 9996;         /* تظهر فوق كل العناصر */
  overflow: hidden;      /* منع أي scroll للخلفية */
}

/* الصندوق الداخلي (نافذة السر) */
#secretWordWindow .secret-box {
  background-color: #222;      /* نفس لون ثيم لعبتك */
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 0 30px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* زر فتح نافذة التخمين */
#openGuessWindow {
  display: block;
  margin: 20px auto;
  padding: 12px 24px;
  font-size: 20px;
  border-radius: 12px;
  background-color: #3a86ff;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#openGuessWindow:hover {
  background-color: #2f6fe0;
  transform: scale(1.05);
}

#openGuessWindow:active {
  transform: scale(0.95);
}

/*notSubmittedCounter التالي ل*/
.counter-box {
  background: linear-gradient(145deg, #1b2150, #13183b);
  color: var(--soft);
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: 0 0 18px rgba(255,152,0,0.35);
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  margin: 10px auto;
  max-width: 320px;
  transition: 0.3s ease;
}

/* Glow خفيف */
.counter-box.active {
  box-shadow: 0 0 25px rgba(255,152,0,0.6);
}
.vote-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 15px;
  border-radius: 12px;
  background-color: var(--card);
color: var(--text);
  box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 8px;

}
.controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
/* زر فتح الشات */
.chat-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 22px;
  z-index: 3000;
  align-items:center;
  justify-content:center;
  display: flex;
}

/* صندوق الشات */
.chat-box {
  position: fixed;
  bottom: 78px;
  right: 16px;

  width: 200px;          /* أصغر */
  height: 235px;         /* أقصر */
  display: none;
  flex-direction: column;

  background: rgba(18, 22, 45, 0.88);
  backdrop-filter: blur(12px);
  border-radius: 18px;

  border: 1px solid rgba(110,160,255,0.25);
  box-shadow:
    0 12px 25px rgba(0,0,0,0.65),
    inset 0 0 20px rgba(110,160,255,0.12);

  z-index: 3000;

  animation: chatPop 0.25s ease;
}

/* حركة فتح لطيفة */
@keyframes chatPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* رأس الشات */
.chat-header {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  color: #e0e6ff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}


/* الرسائل */
.chat-messages {
  flex: 1;
  padding: 8px;
  overflow-y: auto;

  font-size: 14px;
  direction: rtl;
  text-align: right;

  scrollbar-width: thin;
  scrollbar-color: rgba(110,160,255,0.4) transparent;
}

/* سكرول كروم */
.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(110,160,255,0.5);
  border-radius: 6px;
}


/* رسالة */
.chat-msg {
  margin-bottom: 6px;
  line-height: 1.5;
  color: #ffffff;
}

.chat-msg span {
  font-weight: bold;
  color: #6ea0ff;
  margin-left: 4px;
}


/* إدخال */
.chat-input {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-top: 1px solid rgba(255,255,255,0.08);
  direction: rtl;
}

.chat-input input {
  flex: 1;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 10px;
  text-align: right;
  background: rgba(10,15,30,0.8);
}


/* زر الإرسال داخل الشات فقط */
.chat-input button {
  padding: 6px 8px !important;
  font-size: 14px !important;
  width: auto;
  border-radius: 10px;

  background: linear-gradient(145deg, #6ea0ff, #3f6cff);
  box-shadow: 0 0 8px rgba(110,160,255,0.6);
}

/* قلب السهم */
#sendChat {
  transform: scaleX(-1);
}

body.theme-day .chat-box button {
  letter-spacing: 0;
  box-shadow: 0 0 10px rgba(110,160,255,0.6);
}
.chat-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: #ff4d4d;
  border-radius: 50%;
  display: none;
  z-index: 4000;
  animation: pulse 1.2s infinite;
}

/* نبض خفيف */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255,77,77,0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255,77,77,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255,77,77,0);
  }
}



/* أيقونة التحكم */
/* أيقونة التحكم */
.controls-toggle {
  position: fixed;
  top: 48px;
  right: 16px;
  width: 48px;
  height: 48px;
  background: rgba(30,30,50,0.8);
  border: 2px solid rgba(150,200,255,0.9);
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  z-index: 99999; /* 🔥 فوق كل شي */
  pointer-events: auto;
}

.controls-toggle:hover {
  transform: scale(1.1);
  background: rgba(40,40,70,0.9);
}

/* صندوق الأزرار */
.controlsN {
  position: fixed;
  top: 70px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(15, 20, 40, 0.85);
  backdrop-filter: blur(10px);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: none;

  z-index: 99998; /* أقل بشعرة من الأيقونة */
  pointer-events: auto;
}


/* الأزرار داخل الصندوق */
.controlsN button {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: linear-gradient(145deg, #4b60ff, #921aff);
  color: #fff;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(255,50,50,0.5);
}
.controlsN button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255,50,50,0.8);
}
/* تحسين شكل قائمة اختيار اللاعبين */
.controlsN select {
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(40,40,70,0.9);
  color: #fff;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.controlsN select:hover {
  transform: scale(1.03);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.7);
  background: rgba(50,50,90,0.95);
}

/* تحسين شكل زر الطرد */
#kickPlayerBtn {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, #ff4b5c, #ff1a1a);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 50, 50, 0.5);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

#kickPlayerBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 80, 80, 0.8);
  background: linear-gradient(145deg, #ff1a1a, #ff4b5c);
}
/* نص العنوان فوق قائمة اللاعبين */
.kick-label {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 6px;
  display: block;
  text-align: right; /* إذا تحب يكون على اليمين */
}

/* أنيميشن ظهور الرسالة */
@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg {
  animation: msgIn 0.25s ease-out;
}
.chat-toggle.new-msg {
  animation: shake 0.4s ease;
}

@keyframes shakechat {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
.fancy-chat {
  background: radial-gradient(circle at top left, #6ea0ff, #3f6cff);
  box-shadow:
    0 0 12px rgba(110,160,255,0.8),
    0 0 25px rgba(110,160,255,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.fancy-chat:hover {
  transform: scale(1.12);
  box-shadow:
    0 0 18px rgba(110,160,255,1),
    0 0 35px rgba(110,160,255,0.7);
}

/* نبض عند رسالة جديدة */
.fancy-chat.has-new {
  animation: pulseChat 1.4s infinite;
}

@keyframes pulseChat {
  0%   { box-shadow: 0 0 0 0 rgba(110,160,255,0.6); }
  70%  { box-shadow: 0 0 0 14px rgba(110,160,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(110,160,255,0); }
}
/* الحاوية الرئيسية للأزرار أسفل الشاشة */
.voice-controls {
    position: fixed;
    bottom: 30px; /* رفعتها قليلاً لتعطي مساحة */
    left: 20px;   /* وضعها في زاوية الشاشة لليسار */
    display: flex;
    flex-direction: column; /* تحويل الترتيب ليكون عمودياً */
    align-items: center;
    gap: 15px;    /* تقليل المسافة لتناسب الترتيب الرأسي */
    z-index: 10000;
}




/* حاوية المايك (الزر + النص) */
.main-mic-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
	order: 2;
}

/* الدائرة الحمراء */
.mic-circle {
    width: 51px;
    height: 51px;
    background: linear-gradient(145deg, #ff4b2b, #ff416c);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    box-shadow: 0 6px 12px rgba(255, 65, 108, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: box-shadow 0.2s ease;
}

/* النص تحت الزر */
#micText {
    color: white;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    pointer-events: none; /* عشان ما يتحدد بالأزرق */
}

/* التأثير المطلوب: توهج فقط بدون تكبير وبدون تغيير لون */
.main-mic-btn.active .mic-circle {
    box-shadow: 0 0 25px 10px rgba(255, 65, 108, 0.6);
    transform: scale(1); /* الحجم ثابت كما طلبت */
    background: linear-gradient(145deg, #ff4b2b, #ff416c); /* يبقى أحمر */
}

/* زر الاستماع الجانبي */
.side-btn {
	order: 1;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.3s;
}

.side-btn.listen-off {
    opacity: 0.5;
    border-color: #ff4b2b;
}

/* حاوية أسماء المتحدثين (تظهر على اليمين) */
#voice-indicators {
    position: fixed;
    top: 150px; /* المسافة من الأعلى */
    right: 20px; /* الظهور على اليمين كما طلبت */
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.speaker-tag {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    border-right: 4px solid #00ff88; /* خط أخضر جهة اليمين */
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    animation: slideInRight 0.3s ease-out;
	 transition: opacity 0.5s ease, transform 0.5s ease;
}

.speaking-dot {
    width: 8px;
    height: 8px;
    background-color: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff88;
    animation: blink 0.6s infinite alternate;
}

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes blink {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}


/* كلاس يتم إضافته عند الرغبة في الحذف التدريجي */
.fade-out {
    opacity: 0;
    transform: translateX(20px);
}
/* تأكد من إضافة هذا في ملف الـ CSS */
.side-btn.listen-off {
    background: rgba(255, 0, 0, 0.2); /* تظليل أحمر خفيف للمكتوم */
    border-color: #ff4b2b;
}
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}

.install-card {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 2px solid #ff4757;
}

.close-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    margin-top: 20px;
    cursor: pointer;
}
.main-menu {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.btn-main {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    border-radius: 15px;
    border: none;
    background: #ff4757;
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
    transition: transform 0.2s;
}

.btn-main.secondary {
    background: #2ed573;
    box-shadow: 0 4px 15px rgba(46, 213, 115, 0.3);
}

.btn-main:active {
    transform: scale(0.95);
}

.separator {
    margin: 30px 0;
    opacity: 0.2;
}
/* تنسيق إضافي لضبط العناصر في المنتصف */
.main-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.tagline {
    color: var(--soft);
    font-size: 1.1rem;
    margin-top: 10px;
    opacity: 0.8;
}

.divider {
    margin: 25px 0;
    position: relative;
    text-align: center;
    width: 100%;
}

.divider span {
    background: #0b1026; /* نفس لون الخلفية الأساسية */
    padding: 0 15px;
    color: var(--primary);
    font-weight: bold;
    z-index: 1;
    position: relative;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(110, 160, 255, 0.3);
    z-index: 0;
}

/* تعديل حجم الخط للإدخال */
.game-input {
    width: 100%;
    margin-bottom: 15px;
    padding: 18px !important; /* ليكون مريحاً على الجوال */
    border-radius: 12px !important;
    text-align: center;
    font-size: 1.1rem !important;
}

/* أنيميشن Flickering خفيف للشعار */
@keyframes neonFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}
.logo-text {
    animation: neonFlicker 2s infinite;
}
.auth-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* خلفية سوداء شفافة */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* رقم عالي جداً لتكون فوق كل شيء */
}

.auth-card {
    background: rgba(91, 140, 255, 0.3);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.auth-input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.toggle-text {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

.toggle-text span {
    color: #6ea0ff;
    cursor: pointer;
    font-weight: bold;
}
.voice-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-activate-voice {
    background: #ffc107;
    color: #000;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-activate-voice:hover {
    background: #ffdb70;
    transform: scale(1.05);
}
.forgot-password {
    margin-top: 10px;
    font-size: 0.9em;
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
}

.link-span {
    color: #007bff;
    cursor: pointer;
    font-weight: bold;
}