/* fire-farm.css - تحديث متوافق مع Babylon + واجهة أفقية */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #1a0a00, #0f0f0f);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* شاشة التحميل */
#loadingScreen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 30000;
  color: #ff6600;
  background: linear-gradient(135deg, rgba(10,10,10,0.9), rgba(20,20,20,0.9));
}

.loading-logo {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.loading-text {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.loading-bar {
  width: 60%;
  max-width: 600px;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, #ff6600, #ff8533);
  width: 0%;
  transition: width 0.25s ease;
}

/* واجهة المستخدم فوق الكانفاس */
#gameUI {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20000;
}

/* شريط علوي */
.top-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 56px;
  background: linear-gradient(135deg, rgba(16,16,20,0.75), rgba(26,26,26,0.6));
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,102,0,0.12);
}

.back-btn {
  background: transparent;
  border: 2px solid #ff6600;
  color: #ff6600;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

.stats-container {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0,0,0,0.4);
  padding: 0.3rem 0.7rem;
  border-radius: 14px;
  border: 1px solid rgba(255,102,0,0.08);
}

.stat-icon { font-size: 1rem; }
.stat-value { color: #ffcc88; font-weight: bold; }

/* شريط سفلي */
.bottom-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  height: 86px;
  background: linear-gradient(135deg, rgba(16,16,20,0.75), rgba(26,26,26,0.6));
  backdrop-filter: blur(6px);
  pointer-events: auto;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
}

.crops-selector {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 6px;
}

/* عناصر المحصول */
.crop-item {
  min-width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #16161a, #1a1a1a);
  border: 2px solid #333;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.18s ease;
}

.crop-item.selected {
  border-color: #ff6600;
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(255,102,0,0.18);
}

/* أزرار التحكم الجانبية */
.control-buttons {
  position: absolute;
  right: 14px;
  bottom: 110px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: auto;
}

.control-btn {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #ff6600, #ff8533);
  border: none;
  border-radius: 50%;
  color: #000;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,102,0,0.2);
}

/* مؤشرات وتوابع */
.selection-indicator {
  position: absolute;
  width: 64px;
  height: 64px;
  border: 3px solid #ff6600;
  border-radius: 50%;
  pointer-events: none;
  z-index: 500;
  animation: pulse-ring 1s ease-out infinite;
  display: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 1; } 
  100% { transform: scale(1.3); opacity: 0; }
}

/* النوافذ المنبثقة */
.cell-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) scale(0);
  background: linear-gradient(135deg, #16161a, #1a1a1a);
  border: 2px solid #ff6600;
  border-radius: 18px;
  padding: 1.2rem;
  width: 320px;
  max-width: 88%;
  color: #fff;
  z-index: 25000;
  pointer-events: auto;
  transition: transform 0.22s ease;
}
.cell-modal.show {
  transform: translate(-50%,-50%) scale(1);
}
.modal-header { text-align: center; margin-bottom: 0.6rem; }
.modal-emoji { font-size: 3rem; }
.modal-title { color: #ff6600; font-size: 1.2rem; margin-top: 0.4rem; }
.modal-info { display:flex; flex-direction: column; gap: 0.5rem; margin: 0.6rem 0; }
.modal-info-item { display:flex; justify-content:space-between; background:#0f0f12; padding: 0.55rem; border-radius:8px; }
.modal-actions { display:flex; gap:0.5rem; }
.modal-btn { flex:1; padding:0.8rem; border-radius:10px; border:none; cursor:pointer; font-weight:bold; }
.modal-btn-primary { background: linear-gradient(135deg,#ff6600,#ff8533); color:#000; }
.modal-btn-secondary { background: transparent; border:2px solid #ff6600; color:#ff6600; }

/* رسائل عائمة */
.message-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) scale(0);
  background: linear-gradient(135deg,#ff6600,#ff8533);
  color:#000;
  padding:0.8rem 1.2rem;
  border-radius:14px;
  font-weight:bold;
  z-index: 26000;
  pointer-events:none;
}
.message-popup.show { transform: translate(-50%,-50%) scale(1); }

/* استجابة */
@media (max-width: 900px) {
  .control-buttons { right: 10px; bottom: 100px; }
  .bottom-bar { height: 76px; }
  .top-bar { height: 52px; }
}
