/* ============ إعدادات عامة ============ */
body {
  margin: 0;
  background: #0b1220;
  color: #e5e7eb;
  font-family: system-ui, sans-serif;
}

/* ============ HUD (الموارد) ============ */
#hud {
  display: flex;
  gap: 15px;
  padding: 10px;
  background: #111;
  position: sticky;
  top: 0;
  z-index: 10;
}
#hud div {
  background: #1e293b;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
}

/* ============ Stage (المباني) ============ */
#stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  padding: 20px;
}

.card {
  background: #1e293b;
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: 0.2s;
}
.card:hover {
  background: #334155;
}
.card img {
  max-width: 100px;
  display: block;
  margin: 0 auto 10px;
}
.card h3 {
  margin: 0;
  font-size: 16px;
}
.card p {
  margin: 5px 0 0;
  font-size: 14px;
  color: #9ca3af;
}

/* ============ Overlay (نافذة الترقية) ============ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.overlay[hidden] {
  display: none;
}
.window {
  background: #f9fafb;
  color: #111827;
  padding: 20px;
  border-radius: 10px;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
#ov-close {
  position: absolute;
  top: 5px;
  right: 8px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #374151;
}
#ov-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: bold;
}
#ov-img {
  max-width: 120px;
  display: block;
  margin: 0 auto 10px;
}
#ov-costs {
  font-size: 14px;
  margin-bottom: 8px;
}
#ov-desc {
  font-size: 14px;
  color: #4b5563;
}

/* ============ Progress Bar ============ */
#ov-progress {
  background: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
  margin: 10px 0;
  height: 20px;
  position: relative;
}
#ov-progress .bar {
  background: linear-gradient(90deg, #38bdf8, #0ea5e9, #38bdf8);
  background-size: 200% auto;
  animation: shine 2s linear infinite;
  height: 100%;
  width: 0%;
  transition: width 0.3s ease-out;
}
#ov-eta {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: bold;
  color: #111827;
  line-height: 20px;
}

@keyframes shine {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ============ أزرار ============ */
.actions {
  margin-top: 12px;
  text-align: center;
}
.actions button {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}
.actions button:hover {
  background: #1e40af;
}
