body {
  font-family: 'El Messiri', sans-serif;
  color: white;
  margin: 0;
  padding: 20px;
  text-align: center;
  background: none; /* إزالة الخلفية البنفسجية */
  padding-top: 108px;
  background: none; /* ضروري */
  background-color: transparent;
}

body, button, input, textarea, select {
  font-family: 'El Messiri', sans-serif;
}


.background-blur-layer {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("img/bg.png");
  background-size: cover;
  background-position: center;
  z-index: -1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.background-layer {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("img/bg.png");
  background-size: cover;
  background-position: center;
  z-index: -1;
  filter: blur(16px);
  transform: scale(1.2); /* ضروري عشان ميحصلش قص من الأطراف */
  pointer-events: none;
}




.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(255, 255, 255, 0.05); /* شفاف */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid white;
  z-index: 1000;
}

.logo {
  height: 40px;
}


.container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  max-width: 1800px;
  margin: auto;
  align-items: flex-start;
  animation: fadeIn 1s ease-in-out;
}

.sidebar {
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
  box-sizing: border-box;
 /* height: 720px;*/
}

.glow-box {
  border: 2px solid white;
  box-shadow: 0 0 15px #ffffffaa;
  border-radius: 10px;
  animation: fadeInUp 1s ease;
}

textarea {
  height: 560px;
  resize: none;
  padding: 10px;
  font-size: 16px;
  border-radius: 10px;
  border: 2px solid #a86cc1;
  background-color: transparent;
  color: white;
  width: 100%;
  box-sizing: border-box;
  animation: fadeIn 1.5s ease;
}

.buttons {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

button {
  padding: 10px;
  font-size: 16px;
  background-color: #7a1fa2;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.3s;
}

button:hover {
  background-color: #9c27b0;
  transform: scale(1.05);
}


.custom-button {
  flex: 1;
  background: linear-gradient(135deg, #7a1fa2, #9c27b0);
  box-shadow: 0 0 10px #a86cc1;
  font-weight: bold;
  animation: fadeInUp 0.8s ease;
}

.timer-control {
  display: none;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.5s ease-in-out;
}

#timerRange {
  width: 100%;
}

#timerValue {
  font-size: 14px;
  margin-top: 5px;
  color: #ccc;
}

#wheel {
  border-radius: 50%;
  background-color: #fff;
  transition: transform 0.1s;
  animation: fadeIn 1s ease;
}

.wheel-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.4s ease;
}

.modal-content {
  background: #4a0072;
  padding: 0;
  border-radius: 10px;
  width: 600px;
  animation: scaleIn 0.4s ease;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  /*font-family: "Segoe UI", sans-serif;*/
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #6a1b9a;
  padding: 16px 16px;
  color: white;
}

.modal-title {
  font-size: 20px;
  font-weight: bold;
}

.modal-close {
  cursor: pointer;
  font-size: 20px;
  transition: color 0.3s;
}

.modal-close:hover {
  color: #ffb3da;
}

.winner-name {
  font-size: 50px;
  padding: 20px 20px;
  text-align: center;
  font-weight: bold;
  color: gold;
  background-color: #4a0072;
}

.modal-buttons {
  display: flex;
  padding: 15px 20px;
  gap: 16px;
  background-color: #4a0072;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-buttons button {
  padding: 12px 24px;
  font-size: 18px;
  min-width: 120px;
  border-radius: 8px;
  font-weight: bold;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.modal-buttons button:hover {
  background-color: #ab47bc;
  transform: scale(1.05);
}

#cancelDelete {
  background-color: transparent;
  color: white;
  border: 2px solid transparent;
  transition: none;

}

#cancelDelete:hover {
 /* border-color: #ffffff66;*/
  background-color: rgba(255, 255, 255, 0.1);
}

#wheel:hover {
  cursor: pointer;
}




/* وسط العجلة */
#wheel-image {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}




.timer-control {
  display: none;
}
.timer-control.active {
  display: flex;
}

#wheel {
  background-color: transparent;
  border-radius: 50%;
  transition: transform 0.1s;
  animation: fadeIn 1s ease;
}

.wheel-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}


.arrow {
  margin-left: -90px;
  position: absolute;
  top: 50%;
  left: 100%; /* يمين العجلة مباشرة */
  transform: translateY(-50%) rotate(180deg); /* يدور السهم ليبص شمال */
  width: 0;
  height: 0;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-left: 40px solid #ffcc00;
  z-index: 10;
}


#wheel {
  background-color: transparent; /* تأكد أنها شفافة */
  border-radius: 50%;
  box-sizing: border-box;
}


#wheel {
  transition: transform 0.3s ease-in-out;
}


.saved-wheels {
  margin-top: 10px;
  border-top: 1px solid #ffffff22;
  padding-top: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.saved-wheels .wheel-entry {
  display: flex;
  justify-content: space-between;
  margin: 5px 0;
  background: rgba(255,255,255,0.05);
  padding: 6px;
  border-radius: 6px;
}


.layout {
  display: flex;
  gap: 20px;
}

/* الشريط الجانبي */
.sidebar {
  width: 250px;
  background-color: #ffffff0d;
  padding: 15px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

/* محتوى اللعبة */
.main-content {
  flex: 1;
}

/* شكل العجلات المحفوظة */
.saved-wheels {
  margin-top: 10px;
  max-height: 250px;
  overflow-y: auto;
}

.wheel-entry {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  background-color: #ffffff10;
  border-radius: 5px;
  padding: 5px;
}

.sidebar {
  width: 300px; /* بدلاً من 250 مثلاً */
}


/* تنسيق للمدخلات داخل قسم الحفظ والمشاركة */
#wheelName,
#codeInput {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05); /* خلفية شفافة */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-family: 'El Messiri', sans-serif;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s ease;
}

#wheelName:focus,
#codeInput:focus {
  border-color: #ffcc00;
}

/* تنسيق للمدخلات داخل قسم الحفظ والمشاركة */
#wheelName,
#codeInput {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05); /* خلفية شفافة */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-family: 'El Messiri', sans-serif;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s ease;
  width: calc(100% - 4px); /* أو 8px لو padding كبير */

}

#wheelName:focus,
#codeInput:focus {
  border-color: #ffcc00;
}


/* كونتينر حفظ العجلات */
.saved-container {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 15px;
  box-sizing: border-box;
  max-width: 350px;
}

/* مدخلات اسم العجلة وكود المشاركة */
#wheelName,
#codeInput {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-family: 'El Messiri', sans-serif;
  font-size: 16px;
  outline: none;
  box-sizing: border-box; /* 👈 مهم لتفادي الخروج خارج الكونتينر */
}

#wheelName:focus,
#codeInput:focus {
  border-color: #ffcc00;
}


#blocker {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: transparent;
  display: none;
}


@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 10px;
  }
  .sidebar {
    width: 100%;
  }
  .navbar{display: none;}
}


#shareButton {
  background: linear-gradient(135deg, #ffa000, #ffcc00);
  color: black;
  font-weight: bold;
}
#shareButton:hover {
  background: linear-gradient(135deg, #ffc107, #ffeb3b);
}

#shareButton {
  background: linear-gradient(135deg, #ffa000, #ffcc00);
  color: black;
  font-weight: bold;
  margin-top: 10px;
}
#shareButton:hover {
  background: linear-gradient(135deg, #ffc107, #ffeb3b);
}

#open-saved {
  background-color: #f0f0f0;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#open-saved:hover {
  background-color: #e0e0e0;
}


.navbar {
  z-index: 1200; /* تأكد إنها فوق */
}


.sidebar {
  z-index: 1100; /* أعلى من الـ navbar */
}


#saved-container {
  z-index: 1200; /* أعلى من كل حاجة */
}


#saved-container input[type="text"] {
  color: white;
  background-color: transparent;
  border: 1px solid #ccc;
  padding: 8px;
  border-radius: 6px;
}

#saved-container input[type="text"]::placeholder {
  color: #ccc;
}
