/* ============================================================
   BARRA DE RECURSOS
   ============================================================ */
#resource-bar {
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 6px 16px;
  display: none;          /* oculta hasta que haya al menos 1 recurso */
  gap: 16px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

#resource-bar.visible { display: flex; }
#resource-bar::-webkit-scrollbar { display: none; }

.res-item {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  min-width: 108px;
}

/* ── Icono con hover glow ───────────────────────────────── */
.res-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
  cursor: default;
  transition: background 0.15s;
}

.res-icon .gi {
  width: 14px;
  height: 14px;
  color: #fde68a;
  stroke-width: 2;
}

.res-icon:hover {
  background: rgba(253,230,138,0.18);
}

/* ── Tooltip global (posicionado por JS con position:fixed) */
#res-tooltip {
  position: fixed;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 12px;
  line-height: 1.55;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  max-width: 230px;
  pointer-events: none;
  z-index: 9999;
  display: none;
}

#res-tooltip .tt-rate {
  display: block;
  color: #86efac;
  font-weight: 600;
  margin-top: 4px;
  font-size: 11px;
}

.res-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.res-name {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
}

.res-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  width: 68px;
  overflow: hidden;
}

.res-bar-fill {
  height: 100%;
  background: #fde68a;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.res-count {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
}

/* ============================================================
   SECCIÓN DE MISIONES
   ============================================================ */
#missions-section {
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

#missions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- Tarjeta de misión ---- */
.mission-card {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.mission-card.can-complete {
  border-color: #22c55e;
  background: #f0fdf4;
  box-shadow: 0 0 0 1px rgba(34,197,94,0.1);
}

/* ---- Cabecera ---- */
.mission-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.mission-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.mission-tier {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: #e2e8f0;
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.mission-card.can-complete .mission-tier {
  background: #dcfce7;
  color: #15803d;
}

/* ---- Descripción ---- */
.mission-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 10px;
}

/* ---- Requisitos ---- */
.mission-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.req-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--text-muted);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.req-item.met {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.req-have {
  font-size: 10px;
  opacity: 0.7;
}

/* ---- Footer ---- */
.mission-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mission-reward {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.btn-complete {
  background: #22c55e;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 32px;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.btn-complete:hover:not(:disabled) {
  background: #16a34a;
  transform: translateY(-1px);
}

.btn-complete:active:not(:disabled) {
  transform: translateY(0);
}

.btn-complete:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Mensaje cuando no hay misiones disponibles */
.missions-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
  text-align: center;
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 640px) {
  #resource-bar         { padding: 5px 12px; gap: 12px; }
  .res-item             { min-width: 88px; }
  .res-bar-track        { width: 52px; }

  #missions-section     { padding: 12px; }
  .mission-card         { padding: 10px 11px; }
  .mission-name         { font-size: 13px; }
  .mission-desc         { font-size: 11px; margin-bottom: 8px; }
  .req-item             { font-size: 11px; padding: 2px 6px; }
  .mission-reward       { font-size: 12px; }
  .btn-complete         { padding: 6px 12px; font-size: 11px; }
}
